snv: Standard and Robust Normal Variate transformations

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/preprocessing.R

Description

Standard and Robust Normal Variate transformations are often used in chemometrics to normalise a spectra collection and remove the baseline effect.

Usage

1
2
snv(x)
rnv(x, r)

Arguments

x

a vector of numeric values

r

the percentile to use in the RNV computation

Details

The Standard Normal Variate transformation (SNV, Barnes et al., 1989) is a common method to reduce within-class variance.

The Robust Normal Variate transformation (RNV, Guo et al., 1999) is a modification of the SNV to make it more robust to closure problems.

These function are to be used in conjonction with apply_spectra.

Value

A vector of numeric values

Author(s)

Pierre Roudier pierre.roudier@gmail.com

References

See Also

apply_spectra, baseline

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500

# Standard Normal Variate transform
s <- apply_spectra(australia, snv)
plot(s)

# The scale function in the base package is actually doing
# the same thing!
s <- apply_spectra(australia, scale, center = TRUE, scale = TRUE)
plot(s)

# Robust Normal Variate transform
s <- apply_spectra(australia, rnv, r = 0.25)
plot(s)

inspectr documentation built on May 2, 2019, 5:45 p.m.