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

Terry Griffin tgriffin at uaex.edu
Sun May 29 01:39:09 CEST 2011



Terry Griffin, PhD
tgriffin at uaex.edu
501.249.6360

-----Original Message-----
From: Chris English <sglish at hotmail.com>
Sent: Saturday, May 28, 2011 11:20 AM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Creating SpatialGridDataFrame - unequal number of	objects


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 		 	   		  
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list