getPeaks: Find peaks on a curve

Description Usage Arguments Value Author(s) Examples

View source: R/getPeaks.R

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)

CHAT documentation built on May 29, 2017, 10:32 p.m.