Learn R Programming

proximetricsR (version 0.6.5)

prep_snv: Standard Normal Variate constructor for spectral preprocessing

Description

Creates a preprocessing constructor for applying Standard Normal Variate (SNV) normalisation to spectral data. The constructor is intended to be passed to preprocess_recipe and executed via process.

Usage

prep_snv()

Arguments

Value

An object of class preprocessing to be used in preprocess_recipe and executed by process.

Author

Leonardo Ramirez-Lopez with code from Antoine Stevens

Details

SNV normalises each spectrum row-wise by subtracting its mean and dividing by its standard deviation:

SNV_i = x_i - x_is_iSNV_i = (x_i - mean(x_i)) / sd(x_i)

where x_ix_i is the signal of the iith observation, x_ix_i is its mean and s_is_i its standard deviation. Implemented via standardNormalVariate.

References

Barnes RJ, Dhanoa MS, Lister SJ. 1989. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Applied spectroscopy, 43(5): 772-777.

See Also

preprocess_recipe, process

Examples

Run this code
data("NIRcannabis")
X <- NIRcannabis$spc

snv <- prep_snv()
recipe <- preprocess_recipe(snv)
X_snv <- process(X, recipe)

Run the code above in your browser using DataLab