Skip to content
Prev 5590 / 29559 Next

creating polygons

On Thu, 23 Apr 2009, Alina Sheyman wrote:

            
Wrong, as you can see. That isn't how it works. As input, you have 
n Polygons objects in a SpatialPolygons object (with no variables at all, 
no data slot), as output m Polygons objects in a SpatialPolygons object. 
The IDs argument assigns the (possibly multiple) n input Polygons objects 
to the m output Polygons object, which means that IDs must be of length n, 
and express which j=1,m each i=1,n belongs to. So if you do length(IDs), 
it must equal n, and length(unique(IDs)) will equal m. Not complicated, 
not merge, but hard work if you don't have a list of zips broken down by 
districts that lets you create the IDs easily.

Hope this helps,

Roger