linearInterp | R Documentation |
Bivariate Linear Interpolation. Options are available for gridded and pointwise interpolation.
linearInterp(x, y = NULL, z = NULL, gridPoints = 21,
xo = seq(min(x), max(x), length = gridPoints),
yo = seq(min(y), max(y), length = gridPoints))
linearInterpp(x, y = NULL, z = NULL, xo, yo)
x , y , z |
for |
gridPoints |
an integer value specifying the number of grid points in |
xo , yo |
for |
for linearInterp
, a list with at least three entries,
x
, y
and z
. The returned values, can be used
directly in persp
and contour
3D plotting methods.
for linearInterpp
, a data.frame
with columns
"x"
, "y"
, and "z"
.
akimaInterp
and krigeInterp
## Linear 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 = linearInterp(x, y, z, gridPoints = 41)
persp(ans, theta = -40, phi = 30, col = "steelblue",
xlab = "x", ylab = "y", zlab = "z")
contour(ans)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.