# NOT RUN {
data(toydata)
# newdata must have columns with prediction coordinates
newdata = data.frame(x1 = runif(10), x2 = runif(10))
# specify a standard covariance model
mod = cmod_std(model = "exponential", psill = 1, r = 1)
# geolm for universal kriging
geolm_uk = geolm(y ~ x1 + x2, data = toydata, mod = mod,
coordnames = c("x1", "x2"))
# prediction for universal kriging
pred_uk = predict(geolm_uk, newdata, return_type = "geardf")
# heated scatterplot
plot(pred_uk)
# interpolated image of results
plot(pred_uk, interp = TRUE)
# plot only predictions and rmspe with different colors
plot(pred_uk, c("pred", "rmspe"), col = cm.colors(5))
#'plot only predictions with coarser interpolation grid
plot(pred_uk, "pred", interp = TRUE,
interp.args = list(no.X = 10, no.Y = 10))
# }
Run the code above in your browser using DataLab