Learn R Programming

spftir (version 0.1.0)

sppeak: Identification of Peaks of a Mid-infrared Spectra

Description

This function allows to identify peaks of a mid-infrared spectra.

Usage

sppeak(spectra, span = 3, tol = 0.2)

Arguments

spectra
matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.
span
numeric. Peak detection threshold.
tol
numeric. Percentage of the maximum value of the spectrum (positive value).

Value

An object of class sppeak, which is a list of matrices for each of the spectrum.

Examples

Run this code
data(spData)
# Convert data frame to matrix
spectra <- as.matrix(t(spData))
# List of peak detection
pks <- sppeak(spectra=spectra, span=3, tol=0.2)
# Peaks of the first spectrum
pks[[1]]
# Peaks of the second spectrum
pks[[2]]

Run the code above in your browser using DataLab