amax: Local Maxima

Description Usage Arguments Details Value Examples

View source: R/amax.R

Description

Determines all local maxima from a real valued vector.

Usage

1
amax(x)

Arguments

x

numeric vector

Details

The purpose is to detect all local maxima in a real valued 1D vector. If the first element x[1] is the global maximum, it is ignored, because there is no information about the previous element. If there is a plateau, the first edge is detected.

Value

returns the indicies of local maxima. If x[1] = max, then it is ignored.

Examples

1
2
a <- c(1,2,3,2,1,5,5,4)
amax(a) # 3, 6

spectral documentation built on March 29, 2021, 5:10 p.m.

Related to amax in spectral...