Skip to content
Prev 18455 / 29559 Next

spatialdataframe to spatial.polygon

After looking at the data (off-list), I got the following warnings & error:

Warning messages:
1: In is.na(poly[, 1]) :
  is.na() applied to non-(list or vector) of type 'NULL'
2: In is.na(poly[, 1]) :
  is.na() applied to non-(list or vector) of type 'NULL'
Error in coordinates(coords) :
  error in evaluating the argument 'obj' in selecting a method for
function 'coordinates': Error in 1:(na.index[1] - 1) : NA/NaN argument

after checking the arguments, it turns out that polygon has value NULL.

?polygons2spatial.polygon tells that it wants a

    poly: a 2-column matrix of coordinates, where each complete
          subpolygon is separated by NA's

as first argument, but that is not what you give it.
On 06/06/2013 09:04 PM, Kalbasse Group wrote: