Skip to content
Prev 11846 / 29559 Next

Creating SpatialGridDataFrame - unequal number of objects

Re: [R-sig-Geo] R spatial matrix to SpatialGridDataFrameEdzer Pebesma
Tue, 26 Jan 2010 00:54:21 -0800?suggested the following to?Ian McCallum - herein adapted
?bike_1<- list(x = 1:1824, y = 1:1824, z = matrix(rep(1824:1, each=1824), ncol=1824, byrow=TRUE))
This produces the highly desired and previously elusive SGDF. I would neverhave figured out the "data.frame(depth = & etc" myself and have plenty of examples ofSGDF's that contain none of the values I sought to show for my efforts.
This approach requires x=z and so my prior z=y is untenable. When viewed in imagethe values seem rotated clockwise 90 deg, which I guess is just matrix vs raster origin.?
I was hoping to?attain a grid of x= 1824, y= 1368, and z values descending?from 1368:1 by column. ?And thence create a Terragen file through rgdal.
I suppose I can rotate, clip & etc post rgdal but wonder if I can simplify my approach.
Thanks,Chris


----------------------------------------