Skip to content
Prev 7862 / 29559 Next

unionSpatialPolygons

On Thu, 18 Mar 2010, rajkumar at mail.riaex.com wrote:

            
Create a vector (should be a factor) with the output unit IDs, as in ?by 
(INDICES=) or ?aggregate (by=) in base R. unionSpatialPolygons() only 
takes a single vector, so the extension to list arguments doesn't work (if 
anyone needs it, use interaction() to create a single factor from more 
than one). In your case either subset the polygons you wish to dissolve, 
create the ID variable, dissolve, then add back to the dataset, or run the 
operation on the whole data set, where union is a no-op for singleton IDs 
(it only runs for ID counts > 1). Play with by() first to see how the 
index works.

Roger

PS. An affiliation seems appropriate - is this for education, research, 
what?