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.
Usage
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, ...)Arguments
- values
Vector or matrix of values, or object of class
spectra(). Length of vector, ornrowof matrix must match length offrom. Forspectra,fromargument is omitted because it is taken fromwavelengths.- ...
Additional arguments to
stats::splinefun()orstats::approxfun()- from
X values for interpolation (for
spectraobjects, this is assumed to be thewavelengthsattribute.)- to
Y values onto which to interpolate. For
spectraobjects, this should be new wavelengths.- method
One of the methods for
stats::splinefun()(for polynomial and periodic splines) orstats::approxfun()(for constant or linear). Default is"fmm"(same as splinefun).