snv: Standard normal variate transformation (SNV)

View source: R/snv.R

snvR Documentation

Standard normal variate transformation (SNV)

Description

SNV transformation of the row observations (usually spectra) of a data set. By default, each observation is centered on its mean and divided by its standard deviation.

Usage

snv(X, center = TRUE, scale = TRUE)

Arguments

X

A matrix or data frame. The column names of X must be integers (usually the wavelengths).

center

Logical. If TRUE (default), the centering in the SNV is done.

scale

Logical. If TRUE (default), the scaling in the SNV is done.

Value

A matrix of the transformed data.

Examples


data(datcass)

X <- datcass$Xu

z <- snv(X)
#z <- snv(X, center = FALSE)

headm(X)
headm(z)

oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))
plotsp(X, main = "Signal")
plotsp(z, zeroes = TRUE, main = "Corrected signal")
par(oldpar)


mlesnoff/rnirs documentation built on April 24, 2023, 4:17 a.m.