peakwidths | R Documentation |
Summarize peaks based on their shapes and properties.
# Get peak widths
peakwidths(x, peaks, domain = NULL,
fmax = 0.5, ref = c("height", "prominence"))
# Get peak areas
peakareas(x, peaks, domain = NULL)
# Get peak heights
peakheights(x, peaks)
x |
A numeric vector. |
peaks |
The indices (or domain values) of peaks for which the widths or areas should be calculated. |
domain |
The domain variable of the signal. |
fmax |
The fraction of the peak's height used for determining the peak's width. |
ref |
The reference value of the peak for determining the peak width: either the peak height of the peak prominence. |
A numeric vector giving the widths, areas, or heights of the peaks with attributes 'left_bounds' and 'right_bounds' giving the left and right boundaries of the peak.
Kylie A. Bemis
findpeaks
,
findpeaks_cwt
,
binpeaks
,
mergepeaks
x <- c(0, 1, 1, 2, 3, 2, 1, 4, 5, 1, 1, 0)
p <- findpeaks(x)
peakareas(x, p)
peakheights(x, p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.