findPeaks {andurinha}  R Documentation 
findPeaks
Description
This function finds peaks and allows to the most relevant based on the second derivative/absorbance sum spectrum.
Usage
findPeaks(
data,
resolution = 4,
minAbs = 0.1,
cutOff = NULL,
scale = TRUE,
ndd = TRUE
)
Arguments
data 
A data frame object, which contains in the first column the wave numbers and in the following columns the samples absorbances. 
resolution 
The equipment measurement resolution; by default 4 cm1. 
minAbs 
The cut off value to check spectra quality; by default 0.1. 
cutOff 
The second derivative/absorbance sum spectrum cut off to reduce the raw peaks table; by default NULL. 
scale 
By default (TRUE) the data is scaled by Zscores. Use FALSE in case you do not want to scale it. 
ndd 
By default (TRUE) the peaks are searched based on the second derivative sum spectrum. Use FALSE in case you want to search them based on the absorbance sum spectrum. 
Value
A list with a collection of data frames which contains:

dataZ: the standardised data by Zscores.

secondDerivative: the second derivative values of the data.

sumSpectrum_peaksTable: the peaks wave numbers and their second derivative/absorbance sum spectrum values.

peaksTable: the selected peaks wave numbers and their absorbance for each spectrum.
See Also
importSpectra
, gOverview
and
plotPeaks
Examples
# Find Peaks based on the absorbance sum spectrum
fp.abs < findPeaks(andurinhaData, ndd = FALSE)
# See the peaks table of the absorbance sum spectrum
fp.abs$sumSpectrum_peaksTable
# Find Peaks based on the second derivative sum spectrum
fp.ndd < findPeaks(andurinhaData)
# See the peaks table of the second derivative sum spectrum
fp.ndd$sumSpectrum_peaksTable
# Select a cutOff to reduce the number of peaks in the table
# (i.e. select the most relevant)
# fp.ndd$sumSpectrum_peaksTable %>%
# arrange(desc(sumSpectrum))
# Run findPeaks() with the new cutOff
fp.ndd2 < findPeaks(andurinhaData, cutOff = 0.25)