interpol {lazy.tools} | R Documentation |
Interpolation of data
interpol(
x,
y,
xout = NULL,
method = "natural",
n = 3 * length(x),
print = 0,
plot = 0
)
x |
input vector |
y |
input vector |
xout |
vector at which y is calculated, or NULL. |
method |
= "constant" or "linear" or "natural" |
n |
# of points in (min(x), max(x)) at which y is calculated when xout is NULL. |
print |
= 1 to print the result |
plot |
= 1 to plot the result |
A matrix: cbind( xout, yout )
x <- c(1,2,3,4,5,6)
y <- c(1,4,9,7,6,8)
xout <- seq(1, 7, length=10)
sp=interpol( x, y, xout, method="constant", plot=1 )
sp=interpol( x, y, xout, method="linear", plot=1 )
sp=interpol( x, y, xout, method="spline", plot=1 )