interpolate_wl: Map spectra to new wavelength values.
Description
This function returns the result of interpolating spectral data from the original set of
wavelengths to a new one.
Usage
interpolate_wl(x, w.length.out, fill, length.out, ...)
## S3 method for class 'default':
interpolate_wl(x, w.length.out, fill, length.out, ...)
## S3 method for class 'generic_spct':
interpolate_wl(x, w.length.out = NULL, fill = NA,
length.out = NULL, ...)
## S3 method for class 'generic_mspct':
interpolate_wl(x, w.length.out = NULL, fill = NA,
length.out = NULL, ...)
Arguments
x
an R object
w.length.out
numeric array of wavelengths (nm)
fill
a value to be assigned to out of range wavelengths
length.out
numeric value
...
not used
Value
A new spectral object of the same class as argument spct.
Methods (by class)
default: Default for generic function
generic_spct: Interpolate wavelength in an object of class
"generic_spct" or derived.
generic_mspct: Interpolate wavelength in an object of class
"generic_mspct" or derived.
Details
If length.out it is a numeric value, then gives the number of rows in the
output, if it is NULL, the values in the numeric vector w.length.out are used.
If both are not NULL then the range of w.length.out and length.out are
used to generate a vector of wavelength. A value of NULL for fill prevents
extrapolation.