Learn R Programming

spftir (version 0.1.0)

spmblp: Polynomial Baseline Correction of a Matrix of Mid-infrared Spectra

Description

This function allows a polynomial correction of defects of the baseline of a mid-infrared spectrum.

Usage

spmblp(spectra, degree = 2, tol = 0.001, rep = 100)

Arguments

spectra
matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.
degree
numeric. Degree of polynomial. Defaults to 2.
tol
numeric. Tolerance of difference between iterations. Defaults to 0.001.
rep
numeric. Maximum number of iterations. Defaults to 100.

Value

An object of class spmblp, which is a list with the following components:

References

Lieber, C. A., and Mahadevan-Jansen, A. (2003). Automated method for subtraction of fluorescence from biological Raman spectra. Applied spectroscopy, 57(11), 1363-1367.

Examples

Run this code
data(spData)
# Convert data frame to matrix
spectra <- as.matrix(t(spData))
# List of polynomial baseline components
mblp <- spmblp(spectra, degree = 2, tol = 0.001, rep = 100)
# Original matrix
original <- mblp$original
# Baseline matrix
baseline <- mblp$baseline
# Corrected matrix
corrected <- mblp$corrected

Run the code above in your browser using DataLab