Learn R Programming

MazamaSpatialUtils (version 0.7.6)

dissolve: Aggregate shapes in a SpatialPolygonsDataFrame

Description

Aggregate shapes in a spatial polygons dataframe. This is a convenience wrapper for rmapshaper::ms_dissolve()

Usage

dissolve(SPDF, field = NULL, sum_fields = NULL, copy_fields = NULL, ...)

Value

A spatial polygons dataframe with aggregated shapes.

Arguments

SPDF

Object of class SpatialPolygonsDataFrame.

field

Name of the field to dissolve on.

sum_fields

Names of fields to sum.

copy_fields

Names of fields to copy. The first instance of each field will be copied to the aggregated feature

...

arguments passed to rmapshaper::ms_dissolve()

Examples

Run this code
# \donttest{
regions <- dissolve(SimpleCountries, field = "UN_region", sum_fields = "area")
plot(regions)
regions@data
# }

Run the code above in your browser using DataLab