Learn R Programming

spftir (version 0.1.0)

spvalley: Identification of Valleys of a Mid-infrared Spectra

Description

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

Usage

spvalley(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 spvalley, which is a list of matrices for each of the spectra.

Examples

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

Run the code above in your browser using DataLab