pretreat_spectra {waves} | R Documentation |
Pretreat spectral data according to user-designated method
Description
Pretreatment, also known as preprocessing, is often used to
increase the signal to noise ratio in vis-NIR datasets. The waves
function pretreat_spectra
applies common spectral pretreatment
methods such as standard normal variate and the Savitzky-Golay filter.
Usage
pretreat_spectra(
df,
test.data = NULL,
pretreatment = 1,
preprocessing.method = deprecated(),
wavelengths = deprecated()
)
Arguments
df |
data.frame object containing spectral data. First column(s)
(optional) include metadata (with or without reference value column)
followed by spectral columns. Spectral column names must be formatted as
"X" followed by wavelength Include no other columns to right of spectra! No
missing values permitted.
|
test.data |
data.frame object with same format as train.data.
Will be appended to df during pretreatment so that the same
transformations are applied to each row. Default is NULL .
|
pretreatment |
Number or list of numbers 1:13 corresponding to
desired pretreatment method(s):
Raw data (default)
Standard normal variate (SNV)
SNV and first derivative
SNV and second derivative
First derivative
Second derivative
Savitzky–Golay filter (SG)
SNV and SG
Gap-segment derivative (window size = 11)
SG and first derivative (window size = 5)
SG and first derivative (window size = 11)
SG and second derivative (window size = 5)
SG and second derivative (window size = 11)
|
preprocessing.method |
DEPRECATED preprocessing.method
has been renamed "pretreatment"
|
wavelengths |
DEPRECATED wavelengths is no
longer supported; this information is now inferred from df
column names
|
Value
Pretreated df
' (or list of data.frame
s) with
reference column intact
Author(s)
Jenna Hershberger jmh579@cornell.edu
Examples
pretreat_spectra(df = ikeogu.2017, pretreatment = 3)[1:5, 1:5]
[Package
waves version 0.2.5
Index]