Learn R Programming

mdatools (version 0.14.2)

prep.msc: Multiplicative Scatter Correction transformation

Description

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

Usage

prep.msc(data, mspectrum = NULL)

Value

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

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")