peakdet: Detect peak positions

Description Usage Arguments Value Examples

View source: R/peakdet.R

Description

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

Usage

1
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

1
2
3
4
y <- runif(200)
peakdet(y)
y <- sin(seq(0,20))
peakdet(y)

LihuaJulieZhu/NADfinder documentation built on May 17, 2019, 6:21 p.m.