prep.msc: Multiplicative Scatter Correction transformation

View source: R/prep.R

prep.mscR Documentation

Multiplicative Scatter Correction transformation

Description

Applies Multiplicative Scatter Correction (MSC) transformation to data matrix (spectra)

Usage

prep.msc(data, mspectrum = NULL)

Arguments

data

a matrix with data values (spectra)

mspectrum

mean spectrum (if NULL will be calculated from spectra)

Details

MSC is used to remove scatter effects (baseline offset and slope) from spectral data, e.g. NIR spectra.

@examples

### Apply MSC to spectra from simdata

library(mdatools) data(simdata)

spectra = simdata$spectra.c cspectra = prep.msc(spectra)

par(mfrow = c(2, 1)) mdaplot(spectra, type = "l", main = "Before MSC") mdaplot(cspectra, type = "l", main = "After MSC")

Value

preprocessed spectra (calculated mean spectrum is assigned as attribut 'mspectrum')


mdatools documentation built on Sept. 11, 2024, 7:59 p.m.