swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: a4ba0967b3c7f05b70d7e3f625228786cc4290e5 authored by Edzer Pebesma on 06 April 2023, 09:32:40 UTC
version 2.1-1
version 2.1-1
Tip revision: a4ba096
cc.R
library(sp)
demo(meuse, ask = FALSE, echo = FALSE)
library(gstat)
# use collocated data:
g = gstat(NULL, "lzinc", log(zinc)~1, meuse)
g.coll = gstat(g, "dist", dist~1, meuse, nmax = 1, merge = c("lzinc", "dist"))
g.fit = fit.lmc(variogram(g.coll), g.coll, vgm(1, "Sph", 900, 1),
correct.diagonal = 1.01)
g.non_coll = gstat(g, "dist", dist~1, meuse.grid, nmax = 1, merge = c("lzinc", "dist"))
g.non_coll$model = g.fit$model
# collocated cokriging:
pr = predict(g.non_coll, meuse.grid)
spplot(pr[c(1,3)])