Learn R Programming

ptw (version 1.0-7)

interpol: Linear interpolation

Description

This function calculates values at non-integer index positions by linear interpolation.

Usage

interpol(xout, y)

Arguments

xout
points at which to compute interpolated values
y
signal to be interpolated

Value

  • A vector of interpolated values. If any of the values of xout are outside the domain 1:length(y) the output will contain NA at those positions

Details

The C function approx.c that is called by interpol, was copied from the stats package of R-2.15.1. This was done to prevent aberrant behaviour due to changes without notice.

References

R Development Core Team (2012). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org/.

Examples

Run this code
interpol(seq(23, 25, length = 20),10:50)
interpol(seq(23, 25, length = 20),5:50)

Run the code above in your browser using DataLab