LocatePeaks: Find local maxima or minima

View source: R/LocatePeaks.R

LocatePeaksR Documentation

Find local maxima or minima

Description

Find the positions of local maxima or minima in a sequence.

Usage

LocatePeaks(x, minima = FALSE, partial = FALSE)

Arguments

x

numeric vector for which maxima (minima) shall be analysed.

minima

if FALSE (the default) locate the positions of the maxima of x, else locate the positions of the minima.

partial

if TRUE, the first and last data points of x are considered to be maxima or minima as well; defaults to FALSE.

Value

a numeric vector of the index positions of the maxima (minima).

Author(s)

Zhibing He, Dan Cheng

Source

This function is adapted from the function which.peaks in the R package mSTEM: <https://cran.r-project.org/web/packages/mSTEM/index.html>

For the purpose of the prxytools package, the function and its function arguments have been renamed.


EarthSystemDiagnostics/prxytools documentation built on Jan. 15, 2024, 9:33 p.m.