Learn R Programming

mdatools (version 0.11.2)

prep.msc: Multiplicative Scatter Correction transformation

Description

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

Usage

prep.msc(spectra, mspectrum = NULL)

Arguments

spectra

a matrix with spectra values

mspectrum

mean spectrum (if NULL will be calculated from spectra)

Value

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

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