Learn R Programming

baseline (version 1.3-1)

baseline: Baseline correction

Description

Common framework for baseline correction

Usage

baseline(spectra, method = "irls", ...)

Arguments

spectra

Matrix with spectra in rows

method

Baseline correction method

Additional parameters, sent to the method

Value

An object of class '>baseline.

Details

Estimates baselines for the spectra, using the algorithm named in method.

References

Kristian Hovde Liland, Trygve Alm<U+00F8>y, Bj<U+00F8>rn-Helge Mevik (2010), Optimal Choice of Baseline Correction for Multivariate Calibration of Spectra, Applied Spectroscopy 64, pp. 1007-1016.

See Also

The functions implementing the baseline algorithms: baseline.als, baseline.fillPeaks, baseline.irls, baseline.lowpass, baseline.medianWindow, baseline.modpolyfit, baseline.peakDetection, baseline.rfbaseline, baseline.rollingBall, baseline.shirley, baseline.TAP

Examples

Run this code
# NOT RUN {
# Load data
data(milk)
# The baseline() function is an S4 wrapper for all the different 
# baseline correction methods. The default correction method
# is IRLS. Data must be organized as row vectors in a matrix
# or data.frame.
bc.irls <- baseline(milk$spectra[1,, drop=FALSE])
# }
# NOT RUN {
  # Computationally heavy
	plot(bc.irls)
# }
# NOT RUN {
# Available extractors are:
# getBaseline(bc.irls)
# getSpectra(bc.irls)
# getCorrected(bc.irls)
# getCall(bc.irls)

# Correction methods and parameters can be specified through the wrapper.
bc.fillPeaks <- baseline(milk$spectra[1,, drop=FALSE], lambda=6,
	hwi=50, it=10, int=2000, method='fillPeaks')
# }
# NOT RUN {
  # Computationally heavy
	plot(bc.fillPeaks)
# }
# NOT RUN {
# If a suitable gWidgets2 implementation is installed, a 
# graphical user interface is available for interactive
# parameter adaption.
# }
# NOT RUN {
  # Dependent on external software
  baselineGUI(milk$spectra)
# }

Run the code above in your browser using DataLab