peaksign: Find Peaks and Troughs

View source: R/find_peaks.R

peaksignR Documentation

Find Peaks and Troughs

Description

Given a series find local peaks (and troughs) by picking values bigger (smaller) than those on either side. Returns -1 for a trough, +1 for a peak and 0 otherwise functions posted to the r-help mailing list, 25 November 2005 both by Martin Maechler maechler@stat.math.ethz.ch (the first function after code by Petr Pikal, in turn after Biran Ripley) https://stat.ethz.ch/pipermail/r-help/2005-November/083376.html Assumed to be in the public domain.

Usage

peaksign(series, span = 3, do.pad = TRUE)

Arguments

series

the vector of numbers to find peaks in.

span

the window size to use when looking for lower values.

do.pad

pad to the same length as the input seris? Default = TRUE.

Value

return (-1 / 0 / 1) if series[i] is ( trough / "normal" / peak )


yadbor/bluer documentation built on Jan. 31, 2023, 7:44 p.m.