Skip to content
Prev 6830 / 29559 Next

grid error for kriging

On Mon, 9 Nov 2009, Tobin Cara wrote:

            
Please do check the arguments to the formula carefully. If Prec00 is a 
SpatialGridDataFrame, you are not asking for it's i'th variable here. It's 
a design decision that you need Prec00[,,i] to get the variable, or get it 
by name:

library(sp)
data(meuse.grid)
coordinates(meuse.grid) <- c("x", "y")
str(meuse.grid[,1])
gridded(meuse.grid) <- TRUE
str(meuse.grid[,1])
fullgrid(meuse.grid) <- TRUE
str(meuse.grid[,1])
str(meuse.grid[,,1])

Maybe helping some users to subset by row and column has removed the 
otherwise prevalent semantic link to data.frame objects, and maybe this 
(tricky) side of the "[" operator on SpatialGridDataFrame objects should 
be reversed?

Roger