Learn R Programming

spftir (version 0.1.0)

spmbl: Linear Baseline Correction of a Mid-infrared Spectrum

Description

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

Usage

spmbl(spectrum, lbl)

Arguments

spectrum
matrix. The matrix of FTIR spectrum. The first row corresponds to wavenumber; the second row corresponds to absorbance.
lbl
vector. Vector of zero points of absorbance (two or more points).

Value

A corrected spectrum matrix by means of a linear baseline. The first row corresponds to wavenumber; the second row corresponds to absorbance.

Examples

Run this code
data(spData)
# Convert data frame to matrix
spectrum <- as.matrix(t(spData[, c("Wavenumber","A")]))
# Linear baseline correction
mbl <- spmbl(spectrum=spectrum, lbl=c(1800, 1540, 840))

Run the code above in your browser using DataLab