[R-sig-Geo] grid error for kriging

Roger Bivand Roger.Bivand at nhh.no
Mon Nov 9 12:27:38 CET 2009


On Mon, 9 Nov 2009, Tobin Cara wrote:

> Hello,
>
> Has anyone ever used a DTM as their grid for interpolation and come 
> across this error. My DTM has pixels 100 m by 100 m, so I really do not 
> understand this error as it is regular. Also, this only happens when I 
> am doing multiple iterations in time.
>
>
>
> Code:
> list_ked[[i]] <- krige(Prec00[,i]~Zloc, locations=DataCoord, newdata=elev, model = fitted_vario)
> [using universal kriging]
>

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

>
>
> Error:
> suggested tolerance minimum: 0.25
> Error in points2grid(points, tolerance, round, fuzz.tol) :
> dimension 1 : coordinate intervals are not constant
>
>
> I can rescale the DTM to be less refined (now it is 100 m2 for a 6,000 
> km2 area) if needed.
>
> Thank you again,
>
> Cara
>
>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list