Learn R Programming

dSTEM (version 2.0-1)

which.peaks: Find local maxima and local minima of data sequence

Description

Find local maxima and local minima of data sequence

Usage

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

Value

a vector of locations of local maxima or minima

Arguments

x

numerical vector contains local maxima (minima)

partial

logical value indicating if the two endpoints will be considered

decreasing

logical value indicating whether to find local minima

Examples

Run this code
a = 100:1
which.peaks(a*sin(a/3))

Run the code above in your browser using DataLab