Perform cubic spline monotonic interpolation of given data points, returning either a list of points obtained by the interpolation or a function performing the interpolation. The splines are constrained to be monotonically increasing (i.e., the slope is never negative).
Arguments
- x, y
vectors giving the coordinates of the points to be interpolated. Alternatively a single plotting structure can be specified: see
xy.coords
.- n
interpolation takes place at n equally spaced points spanning the interval [
xmin
,xmax
].- xmin
left-hand endpoint of the interpolation interval.
- xmax
right-hand endpoint of the interpolation interval.
- ...
Other arguments are ignored.
Value
- cm.spline
returns a list containing components
x
andy
which give the ordinates where interpolation took place and the interpolated values.- cm.splinefun
returns a function which will perform cubic spline interpolation of the given data points. This is often more useful than
spline
.
Details
These are simply wrappers to the splinefun
function family from the stats package.