R Under development (unstable) (2024-09-04 r87094 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # test -- load data: > library(sp) > data(meuse) > coordinates(meuse) = ~x+y > data(meuse.grid) > gridded(meuse.grid) = ~x+y > > library(gstat) > # test -- idw > meuse.grid$idw <- idw0(zinc~1, meuse, meuse.grid)[,1] > x <- idw(zinc~1, meuse, meuse.grid) [inverse distance weighted interpolation] > all.equal(x$var1.pred, meuse.grid$idw) [1] TRUE > spplot(meuse.grid["idw"],col.regions=bpy.colors()) > v = vgm(1, "Exp", 500) > # test sk: > x0 <- krige0(zinc~1, meuse, meuse.grid, v, beta = 500, computeVar = TRUE) > rownames(x0$pred)=NULL > x <- krige(zinc~1, meuse, meuse.grid, v, beta = 500) [using simple kriging] > all.equal(x$var1.pred, x0$pred[,1]) [1] TRUE > all.equal(x$var1.var, x0$var) [1] TRUE > # test ok: > x0 <- krige0(zinc~1, meuse, meuse.grid, v, computeVar = TRUE) > rownames(x0$pred)=NULL > names(x0$var)=NULL > x <- krige(zinc~1, meuse, meuse.grid, v) [using ordinary kriging] > all.equal(x$var1.pred, x0$pred[,1]) [1] TRUE > all.equal(x$var1.var, x0$var) [1] TRUE > # test uk: > x0 <- krige0(zinc~sqrt(dist), meuse, meuse.grid, v, computeVar = TRUE) > rownames(x0$pred)=NULL > names(x0$var)=NULL > x <- krige(zinc~sqrt(dist), meuse, meuse.grid, v) [using universal kriging] > all.equal(x$var1.pred, x0$pred[,1]) [1] TRUE > all.equal(x$var1.var, x0$var) [1] TRUE > > proc.time() user system elapsed 2.57 0.48 3.03