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)
linearInterp
the arguments x
and y
are
two numeric vectors of grid pounts, and z
is a numeric
matrix or any other rectangular object which can be transformed
by the functiox
and y
direction.linearInterp
two numeric vectors of data points spanning the grid, and
for linearInterpp
two numeric vectors of data points building pairs for pointwise
interpolation.linearInterp
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.
linearInterpp
returns a data.frame with columns "x"
, "y"
,
and "z"
.
akimaInterp
, and krigeInterp
.## linearInterp -
# Linear Interpolation:
if (require(akima)) {
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)
}
Run the code above in your browser using DataLab