resample.Rd
Convenient wrapper around base R's splinefun
and approxfun
. See
stats::splinefun()
and stats::approxfun()
documentation for information
on different spline methods and additional arguments.
resample(values, ...)
# Default S3 method
resample(values, from, to, method = "fmm", ...)
# S3 method for class 'matrix'
resample(values, from, to, ...)
# S3 method for class 'spectra'
resample(values, to, ...)
Vector or matrix of values, or object of class spectra()
.
Length of vector, or nrow
of matrix must match length of from
. For
spectra
, from
argument is omitted because it is taken from
wavelengths
.
Additional arguments to stats::splinefun()
or
stats::approxfun()
X values for interpolation (for spectra
objects, this is
assumed to be the wavelengths
attribute.)
Y values onto which to interpolate. For spectra
objects, this
should be new wavelengths.
One of the methods for stats::splinefun()
(for polynomial
and periodic splines) or stats::approxfun()
(for constant or linear).
Default is "fmm"
(same as splinefun).
Object of the same class as values
, resampled to the to
values.