[R-sig-Geo] Creating SpatialGridDataFrame - unequal number of objects

Chris English sglish at hotmail.com
Sat May 28 18:18:30 CEST 2011


Dear List:
I have a SpatialGrid for which I am trying to make adata.frame and thence a SpatialGridDataFrame.
I can't seem to get the size of data.frame and gridto match up.  I assume I'm missing something straight forward.

 summary(grid1)Object of class SpatialGridCoordinates:  min    maxx 0.5 1824.5y 0.5 1368.5Is projected: NA proj4string : [NA]Number of points: 2Grid attributes:  cellcentre.offset cellsize cells.dimx                 1        1      1824y                 1        1      1368> help(str)> bike_mat<- matrix(rep(1368:1, each=1824), ncol=1824, byrow=TRUE)> bike_df<- as.data.frame(bike_mat)> bike_sgdf_1<- SpatialGridDataFrame(grid1,bike_df)Error in validityMethod(object) :   unequal number of objects in full grid and data slot
Thank you for you assistance.
Chris 		 	   		  


More information about the R-sig-Geo mailing list