peakwidths: Peak Summarization

View source: R/signal.R

peakwidthsR Documentation

Peak Summarization

Description

Summarize peaks based on their shapes and properties.

Usage

# 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)

Arguments

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.

Value

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.

Author(s)

Kylie A. Bemis

See Also

findpeaks, findpeaks_cwt, binpeaks, mergepeaks

Examples

x <- c(0, 1, 1, 2, 3, 2, 1, 4, 5, 1, 1, 0)

p <- findpeaks(x)

peakareas(x, p)
peakheights(x, p)

kuwisdelu/matter documentation built on Oct. 19, 2024, 10:31 a.m.