Skip to contents

The easiest way to create a grouped SpatVector is to call the group_by() method on a SpatVector: this will take care of capturing the unevaluated expressions for you. See group_by.SpatVector() for details.

This function is the adapted version of dplyr::is_grouped_df().

See also group_data.SpatVector() for the accessory functions that retrieve various metadata from a grouped SpatVector.

Usage

is_grouped_spatvector(x)

Arguments

x

A SpatVector created with terra::vect().

Value

TRUE if x is a grouped SpatVector, otherwise FALSE.

Examples

v <- terra::vect(system.file("extdata/cyl.gpkg", package = "tidyterra"))

is_grouped_spatvector(v)
#> [1] FALSE

grouped <- group_by(v, iso2)

is_grouped_spatvector(grouped)
#> [1] TRUE