peakdet: Detect peak positions

View source: R/peakdet.R

peakdetR Documentation

Detect peak positions

Description

Detect the peak positions and valley positions leveraging github::dgromer/peakdet

Usage

peakdet(y, delta = 0, silence = TRUE)

Arguments

y

A numeric vector for searching peaks

delta

A numeric vector of length 1, defining the minimum absolute changes required for local maximum or minimum detection when slope sign changes. If it is set to 0, the delta will be set to 1/10 of the range of y.

silence

logical(1). If false, echo the delta value when delta is set as 0.

Value

A list with peakpos and valleypos. Both peakpos and valleypos are numeric vectors storing the positions of peaks or valleys.

Examples

y <- runif(200)
peakdet(y)
y <- sin(seq(0,20))
peakdet(y)

jianhong/NADfinder documentation built on Oct. 29, 2023, 11:08 a.m.