Learn R Programming

spftir (version 0.1.0)

spder: N-derived of a Mid-infrared Spectra

Description

This function allows to determine the n-derivative of a mid-infrared spectra.

Usage

spder(spectra, order = 2, p = 3, sw = 11)

Arguments

spectra
matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.
order
numeric. Order of derivative. Defaults to 2.
p
numeric. Polynomial order (p>order). Defaults to 3.
sw
numeric. Filter length (must be odd). Defaults to 11.

Value

A derivated spectra matrix. The first row corresponds to wavenumber; the second row corresponds to absorbance.

Examples

Run this code
data(spData)
# Convert data frame to matrix
spectra <- as.matrix(t(spData))
# Derivative spectra
der <- spder(spectra=spectra, order=2, p=3, sw= 11)

Run the code above in your browser using DataLab