Skip to content
Prev 15323 / 29559 Next

Combining polygons from a SpatialPolygonsDataFrame object

Hi Jes?s,
Check out maptools::unionSpatialPolygons. This function takes a spatial polygons object and aggregates polygons according to a vector ID which tell the function what input polygons belong to which output polygons, in your case the province IDs.

Note you may need to set gpclibPermit() to allow use of the gpclib package if rgeos is not available on your system.

HTH,

Simon


--------------------------------
Simon O'Hanlon, BSc MSc
Department of Infectious Disease Epidemiology
Imperial College London
St. Mary's Hospital
London
W2 1PG