Aggregate shapes in a simple features dataframe. This is a
convenience wrapper for ms_dissolve
.
dissolve(SFDF, field = NULL, sum_fields = NULL, copy_fields = NULL, ...)
Object of class simple features data frame.
Name of the field to dissolve on.
Names of fields to sum.
Names of fields to copy. The first instance of each field will be copied to the aggregated feature
arguments passed to rmapshaper::ms_dissolve()
A simple features dataframe with aggregated shapes.
# \donttest{
regions <- dissolve(SimpleCountries, field = "UN_region", sum_fields = "area")
plot(regions)
dplyr::glimpse(regions)
#> Rows: 6
#> Columns: 3
#> $ area <int> 0, 0, 0, 0, 0, 0
#> $ UN_region <chr> "Asia", "Americas", "Africa", "Europe", "Oceania", "Antarcti…
#> $ geometry <MULTIPOLYGON [°]> MULTIPOLYGON (((117.907 4.1..., MULTIPOLYGON (((-68.44861 -.…
# }