Learn R Programming

rchemo (version 0.1-3)

snv: Standard normal variate transformation (SNV)

Description

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

Usage

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

Value

A matrix of the transformed data.

Arguments

X

X-data (\(n, p\)).

center

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

scale

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

Examples

Run this code

data(cassav)

X <- cassav$Xtest

Xp <- snv(X)

oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))
plotsp(X, main = "Signal")
plotsp(Xp, main = "Corrected signal")
abline(h = 0, lty = 2, col = "grey")
par(oldpar)

Run the code above in your browser using DataLab