Skip to content
Prev 6437 / 29559 Next

adding ids and df to hexagonal polys ?

Thanks for the hints here... but I'm guessing that there's somethings
missing...

the 5th command line (row.names(o) <- row.names(hpoly)) does not make
sense to me as hpoly is a spatialPolygon which has no row names
Formal class 'SpatialPolygons' [package "sp"] with 4 slots
  ..@ polygons   :List of 965
  ..@ plotOrder  : int [1:965] 1 2 3 4 5 6 7 8 9 10 ...
  ..@ bbox       : num [1:2, 1:2] 446230 3778428 1331230 8047934
  .. ..- attr(*, "dimnames")=List of 2
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
Length  Class   Mode 
     0   NULL   NULL 

I thought, perhaps there's a spelling problem? but no...
Error in SpatialPolygonsDataFrame(hpoly, data = o) : 
  row.names of data and Polygons IDs do not match

How is this possible?


So I tried a "brute force" approach, with no success
Error in `rownames<-`(x, value) : 
  attempt to set rownames on object with no dimensions

I seem to have the concept wrong to begin with here. How are IDs
assigned to a 'SpatialPolygons' class? I should be able to assign them
regardless of the template shape used, right? Which would make the
overlay() step unnecessary?


I guess that I need some clarification on how the class is built..
my apologies if it's too obvious of a  question... I just hope not to be
the only one missing this
 thanks
On Thu, 2009-09-10 at 09:22 +0200, Roger Bivand wrote: