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.
Arguments
- x
A
SpatVectorcreated withterra::vect().
See also
Other helpers:
compare_spatrasters(),
is_regular_grid(),
pull_crs()
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
