Bivariate Spline Interpolation
Interpolates bivariate data sets using Akima spline interpolation.
akimaInterp(x, y = NULL, z = NULL, gridPoints = 21, xo = seq(min(x), max(x), length = gridPoints), yo = seq(min(y), max(y), length = gridPoints), extrap = FALSE) akimaInterpp(x, y = NULL, z = NULL, xo, yo, extrap = FALSE)
x, y, z |
for |
gridPoints |
an integer value specifying the number of grid points in |
xo, yo |
for |
extrap |
a logical, if |
Two options are available gridded and pointwise interpolation.
akimaInterp
is a function wrapper to the interp
function provided by the contributed R package akima
.
The Fortran code of the Akima spline interpolation routine was
written by H. Akima.
Linear surface fitting and krige surface fitting are provided by
the functions linearInterp
and krigeInterp
.
returns a list with at least three entries, x
, y
and z
. Note, that the returned values, can be directly
used by the persp
and contour
3D plotting methods.
returns a data.frame with columns "x"
, "y"
,
and "z"
.
IMPORTANT: The contributed package akima is not in the dependence list of the DESCRIPTION file due to license conditions. The user has to install this package from CRAN on his own responsibility, please check the license conditions.
Akima H., 1978, A Method of Bivariate Interpolation and Smooth Surface Fitting for Irregularly Distributed Data Points, ACM Transactions on Mathematical Software 4, 149-164.
Akima H., 1996, Algorithm 761: Scattered-Data Surface Fitting that has the Accuracy of a Cubic Polynomial, ACM Transactions on Mathematical Software 22, 362-371.
## The akima library is not auto-installed because of a different licence. ## Does not run for r-solaris-x86 ## akimaInterp -- Akima Interpolation: if (requireNamespace("akima")) { 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") }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.