which.peaks: Find local maxima and minima in a sequence

Description Usage Arguments Value Examples

View source: R/whichPeaks.R

Description

Find local maxima and minima in a sequence

Usage

1
which.peaks(x, partial = FALSE, decreasing = FALSE)

Arguments

x

a vector with maxima or minima

partial

endpoints will be considered if 'true'

decreasing

find local minima if 'true', ortherwise local maxima

Value

a vector of positions of local maxima or minima

Examples

1
2
a = 100:1
which.peaks(a*sin(a/3))

Example output

[1]  2 21 40 58 77 95

mSTEM documentation built on Oct. 2, 2019, 5:03 p.m.