# \donttest{
## Does not run for r-solaris-x86
## akimaInterp -- Akima Interpolation:
if (requireNamespace("interp")) {
set.seed(1953)
x <- runif(999) - 0.5
y <- runif(999) - 0.5
z <- cos(2*pi*(x^2+y^2))
ans <- akimaInterp(x, y, z, gridPoints = 41, extrap = FALSE)
persp(ans, theta = -40, phi = 30, col = "steelblue",
xlab = "x", ylab = "y", zlab = "z")
contour(ans)
}
## Use spatial as alternative on r-solaris-x86
## spatialInterp - Generate Kriged Grid Data:
if (requireNamespace("spatial")) {
RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion")
set.seed(4711, kind = "Marsaglia-Multicarry")
x <- runif(999)-0.5
y <- runif(999)-0.5
z <- cos(2*pi*(x^2+y^2))
ans <- krigeInterp(x, y, z, extrap = FALSE)
persp(ans)
title(main = "Kriging")
contour(ans)
title(main = "Kriging")
}
# }
Run the code above in your browser using DataLab