Find peaks on a curve

Description

Find all the local maxima and their corresponding positions in a given curve.

Usage

1
getPeaks(x, y, sep = 8, thr = 0.01)

Arguments

x

x coordinates for the curve.

y

y coordinates for the curve.

sep

number of initial split of the curve.

thr

sensitivity threshold to call a local maxima.

Value

numeric matrix with two columns: position of peaks and peak values.

Author(s)

Bo Li

Examples

1
2
3
Y=c(rnorm(50,0.4,0.05),rnorm(50,0.8,0.05))
fit=density(Y)
getPeaks(fit$x,fit$y)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.