Learn R Programming

spftir (version 0.1.0)

sptrun: Truncation of a Region of a Mid-Infrared Spectral Matrix

Description

Allow to trim a region of the spectra defined between two wavenumbers.

Usage

sptrun(spectra, limInf, limSup)

Arguments

spectra
matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.
limInf
numeric. Upper wavenumber limit of the spectral region.
limSup
numeric. Lower wavenumber limit of the spectral region.

Value

A truncated matrix within two wavenumber limits. The first row corresponds to wavenumber; the remaining rows corresponds to absorbances.

Examples

Run this code
data(spData)
# Convert data frame to matrix
spectra <- as.matrix(t(spData))
# Truncated
trn <- sptrun(spectra=spectra, limInf=800, limSup=2000)

Run the code above in your browser using DataLab