snv: Standard Normal Variate

View source: R/snv.R

snvR Documentation

Standard Normal Variate

Description

This function performs Standard Normal Variate (SNV) scaling on the input spectral data. SNV scaling scales each row of the input data to have zero mean and unit standard deviation. This is equivalent to autoscaling the transpose of the input data.

Usage

snv(x, drop_na = TRUE, drop.na = deprecated())

Arguments

x

A numeric matrix or data frame.

drop_na

A logical value indicating whether to remove spectra (rows) containing missing values. If TRUE (the default), such rows are removed.

drop.na

[Deprecated] Use drop_na.

Value

A list with the following components:

correction

The SNV-scaled data.

means

A vector of row means.

stds

A vector of row standard deviations.

Author(s)

Christian L. Goueguel

Examples

data(forageLIBS)
spectra <- forageLIBS[-(1:14)]  # the spectral channels
corrected <- snv(spectra)$correction
corrected[1:3, 1:4]

specProc documentation built on Nov. 20, 2026, 5:11 p.m.