TITLE(approx @@ Linear Interpolation)
USAGE(
approx(x, y, xout, method="linear", n=50, rule=1)
)
ALIAS(approx)
ARGUMENTS(
ARG(x,y @@ vectors giving the coordinates of the points to be interpolated.
Alternatively a single plotting structure can be specified.)
ARG(xout @@ an optional set of values specifying where
interpolation is to take place.)
ARG(method @@ this specifies the interpolation method to be used.
Currently this is ignored and linear interpolation
is always used.)
ARG(n @@ If LANG(xout) is not specified, interpolation
takes place at LANG(n) equally spaced points spanning the interval
LANG([min(x),max(x)]).)
ARG(rule @@ an integer describing how interpolation is to take
place outside the interval
LANG([min(x),max(x)]).
If LANG(rule) is LANG(1) then LANG(NA)s
are returned for such points and if it is LANG(2),
the value at the closest data extreme is used.)
)
VALUE(
A list containing LANG(n) x and y coordinates
which linearly interpolate the given data points.
PARA
The function LANG(approxfun) returns a function which will perform linear
interpolation of the given data points.  For a given set of LANG(x)
values this function will return the corresponding interpolated
values.  This is often more useful than LANG(approx).
)
SEEALSO(
LANG(LINK(approxfun)), LANG(LINK(spline)), LANG(LINK(splinefun)).
)
EXAMPLES(
x <- 1:10
y <- rnorm(10)
plot(x, y)
points(approx(x, y), col=1, pch='*')
)
