Learn R Programming

mSTEM (version 1.0-1)

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

Description

Find local maxima and minima in a sequence

Usage

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

Run this code
# NOT RUN {
a = 100:1
which.peaks(a*sin(a/3))
# }

Run the code above in your browser using DataLab