View source: R/prep_resample.R
| prep_resample | R Documentation |
Creates a preprocessing constructor for resampling spectral data to a new
wavelength grid. The constructor is intended to be passed to
preprocess_recipe and executed via process.
prep_resample(grid)
grid |
Either a numeric vector of length 3 specifying the target
wavelength grid as When
Extrapolation beyond the range of the input wavelengths is never allowed. |
User-defined grid (grid = c(min_wav, max_wav, resolution)):
resamples spectra to the specified target grid using natural spline
interpolation via resample. Column names of
X must be coercible to numeric wavelength values. This mode is
compatible with the "proximate" device.
NeoSpectra grid (grid = "proxiscout"): resamples spectra to
the standard wavenumber grid of NeoSpectra NIR scanners
(approx. 3921.569 to 7407.407 cm^{-1}, ~256 channels at ~13.617
cm^{-1} steps). Only wavenumbers overlapping with the input range are
retained. This mode is compatible with the "proxiscout" device.
An object of class preprocessing to be used in
preprocess_recipe and executed by process.
Leonardo Ramirez-Lopez and Claudio Orellano
preprocess_recipe, process,
get_proxiscout_wavenumbers
data("proximateCannabis")
X <- proximateCannabis$spc
# User-defined grid (proximate)
rs <- prep_resample(grid = c(1001, 1700, 2))
recipe <- preprocess_recipe(rs, device = "proximate")
X_rs <- process(X, recipe)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.