countPeaks: Count the number of peaks in 'MassPeaks' objects

View source: R/countPeaks.R

countPeaksR Documentation

Count the number of peaks in MassPeaks objects

Description

This function provides the number of peaks of each element of a list of MassPeaks objects.

Usage

countPeaks(x)

Arguments

x

A list of MassPeaks objects.

Value

A vector consisting of the number of peaks for each peak profile in x.

Examples

# Load example data

data(spectra) # list of MassSpectra class objects

# Some pre-processing

spectra <- screenSpectra(spectra)$fspectra
spectra <- transformIntensity(spectra, method = "sqrt")
spectra <- wavSmoothing(spectra)
spectra <- removeBaseline(spectra)
peaks <- detectPeaks(spectra)

# Count peaks

npeaks <- countPeaks(peaks)

MALDIrppa documentation built on March 29, 2022, 1:05 a.m.