# NOT RUN {
library(sp)
library(spacetime)
sumMetricVgm <- vgmST("sumMetric",
space=vgm( 4.4, "Lin", 196.6, 3),
time =vgm( 2.2, "Lin", 1.1, 2),
joint=vgm(34.6, "Exp", 136.6, 12),
stAni=51.7)
data(air)
if (!exists("rural"))
rural = STFDF(stations, dates, data.frame(PM10 = as.vector(air)))
rr <- rural[,"2005-06-01/2005-06-03"]
rr <- as(rr,"STSDF")
x1 <- seq(from=6,to=15,by=1)
x2 <- seq(from=48,to=55,by=1)
DE_gridded <- SpatialPoints(cbind(rep(x1,length(x2)), rep(x2,each=length(x1))),
proj4string=CRS(proj4string(rr@sp)))
gridded(DE_gridded) <- TRUE
DE_pred <- STF(sp=as(DE_gridded,"SpatialPoints"), time=rr@time)
DE_kriged <- krigeST(PM10~1, data=rr, newdata=DE_pred,
modelList=sumMetricVgm)
gridded(DE_kriged@sp) <- TRUE
stplot(DE_kriged)
# }
Run the code above in your browser using DataLab