Learn R Programming

baseline (version 1.3-5)

baseline.rfbaseline: Robust Baseline Estimation

Description

Wrapper for Andreas F. Ruckstuhl, Matthew P. Jacobson, Robert W. Field, James A. Dodd's algorithm based on LOWESS and weighted regression

Usage

baseline.rfbaseline(spectra, span = 2/3, NoXP = NULL, maxit = c(2, 2),
  b = 3.5, weight = NULL, Scale = function(r) median(abs(r))/0.6745,
  delta = NULL, SORT = FALSE, DOT = FALSE, init = NULL)

Value

baseline

Matrix of baselines corresponding to spectra spectra

corrected

Matrix of baseline corrected spectra

Arguments

spectra

Matrix with spectra in rows

span

Amount of smoothing (by fraction of points)

NoXP

Amount of smoothing (by number of points)

maxit

Maximum number of iterations in robust fit

b

Tuning constant in the biweight function

weight

Optional weights to be given to individual observations

Scale

S function specifying how to calculate the scale of the residuals

delta

Nonnegative parameter which may be used to save computation. (See rfbaseline

SORT

Boolean variable indicating whether x data must be sorted.

DOT

Disregard outliers totally (boolean)

init

Values of initial fit

Author

Kristian Hovde Liland and Bjørn-Helge Mevik

Details

Most of the code is the original code as given by the authors. The ability to sort by X-values has been removed and ability to handle multiple spectra has been added

References

Andreas F. Ruckstuhl, Matthew P. Jacobson, Robert W. Field, James A. Dodd: Baseline subtraction using robust local regression estimation

Examples

Run this code
data(milk)
bc.rbe <- baseline(milk$spectra[1,, drop=FALSE], method='rfbaseline',
  span=NULL, NoXP=1000)
if (FALSE) {
	plot(bc.rbe)
}

Run the code above in your browser using DataLab