preprocess: Function to preprocess on spectra.

Description Usage Arguments Value Author(s) References Examples

View source: R/preprocess.R

Description

This function accepts spectra, performs the desired transformations, and returns the results. The full list of available transformations is specified below under the parameter "transformation."

Usage

1
preprocess(spec, transformation, MSC_reference = NULL)

Arguments

spec

An object of class spectra.list or spectra.matrix.

transformation

The desired transformation. Selected from:
"RAW" - The raw spectrum, as supplied, is returned.
"D1f" - The first derivative.
"D2f" - The second derivative.
"COE" - Constant Offset Elimination.
"SLS" - Straight Line Subtraction.
"SNV" - Vector Normalization.
"MMN" - Min/Max Normalization.
"MSC" - Multiplicative Scattering Correction (Isaksson and N<c3><a6>s, 1988).

MSC_reference

A reference used in MSC prepreocessing. If NULL, the mean spectra of the provided spectra is used.

Value

Returns an object of class spectra.matrix. If MSC was performed, the mean/reference spectra is returned as an attribute called "MSC_reference."

Author(s)

Daniel M Griffith

References

Tomas Isaksson and Tormod N<c3><a6>s, "The Effect of Multiplicative Scatter Correction (MSC) and Linearity Improvement in NIR Spectroscopy," Appl. Spectrosc. 42, 1273-1284 (1988)

Examples

1
2
3
4
5
6
7
8
## Not run: 
data(shootout)
processed_data <- preprocess(spec = shootout_scans, transformation = "COE")
par(mfrow=c(1,2))
plot(shootout_scans)
plot(processed_data)

## End(Not run)

griffithdan/plantspec documentation built on May 17, 2019, 8:37 a.m.