r - Error on using spCbind with identical ‘"SpatialPolygonsDataFrame" structures -
i'm using cpcbind 'cbind' spatialpolygondataframes. receive error:
*unable find inherited method function ‘spcbind’ signature ‘"spatialpolygonsdataframe", "spatialpolygonsdataframe"’*
here's output of str( sps) , str( spso ), 2 dataframes want pass cpcbind( sps, spso). both spatialpolygonsdataframe have 2 columns , same number of rows; same projection, same id. that's different values in columns because these differently located polygons.
str(sps) formal class 'spatialpolygonsdataframe' [package "sp"] 5 slots ..@ data :'data.frame': 1 obs. of 1 variable: .. ..$ id: int 1 ..@ polygons :list of 1 .. ..$ :formal class 'polygons' [package "sp"] 5 slots .. .. .. ..@ polygons :list of 1 .. .. .. .. ..$ :formal class 'polygon' [package "sp"] 5 slots .. .. .. .. .. .. ..@ labpt : num [1:2] 2876 5018 .. .. .. .. .. .. ..@ area : num 53871 .. .. .. .. .. .. ..@ hole : logi false .. .. .. .. .. .. ..@ ringdir: int 1 .. .. .. .. .. .. ..@ coords : num [1:362, 1:2] 3061 2690 2690 2690 2690 ... .. .. .. ..@ plotorder: int 1 .. .. .. ..@ labpt : num [1:2] 2876 5018 .. .. .. ..@ id : chr "1" .. .. .. ..@ area : num 53871 ..@ plotorder : int 1 ..@ bbox : num [1:2, 1:2] 2690 4939 3061 5124 .. ..- attr(*, "dimnames")=list of 2 .. .. ..$ : chr [1:2] "x" "y" .. .. ..$ : chr [1:2] "min" "max" ..@ proj4string:formal class 'crs' [package "sp"] 1 slot .. .. ..@ projargs: chr "+proj=merc +lon_0=-100 +k=1 +x_0=0 +y_0=0 +ellps=wgs84 +datum=wgs84 +units=km +no_defs +towgs84=0,0,0"
and------------------------------------------------------ str( spso )
formal class 'spatialpolygonsdataframe' [package "sp"] 5 slots ..@ data :'data.frame': 1 obs. of 1 variable: .. ..$ id: int 1 ..@ polygons :list of 1 .. ..$ :formal class 'polygons' [package "sp"] 5 slots .. .. .. ..@ polygons :list of 1 .. .. .. .. ..$ :formal class 'polygon' [package "sp"] 5 slots .. .. .. .. .. .. ..@ labpt : num [1:2] 330 3937 .. .. .. .. .. .. ..@ area : num 53871 .. .. .. .. .. .. ..@ hole : logi false .. .. .. .. .. .. ..@ ringdir: int 1 .. .. .. .. .. .. ..@ coords : num [1:362, 1:2] 515 145 145 145 145 ... .. .. .. ..@ plotorder: int 1 .. .. .. ..@ labpt : num [1:2] 330 3937 .. .. .. ..@ id : chr "1" .. .. .. ..@ area : num 53871 ..@ plotorder : int 1 ..@ bbox : num [1:2, 1:2] 145 3858 515 4044 .. ..- attr(*, "dimnames")=list of 2 .. .. ..$ : chr [1:2] "x" "y" .. .. ..$ : chr [1:2] "min" "max" ..@ proj4string:formal class 'crs' [package "sp"] 1 slot .. .. ..@ projargs: chr "+proj=merc +lon_0=-100 +k=1 +x_0=0 +y_0=0 +ellps=wgs84 +datum=wgs84 +units=km +no_defs +towgs84=0,0,0"
Comments
Post a Comment