peaks | R Documentation |
Given a series find local peaks by picking values bigger than those on either side 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 Brian Ripley) https://stat.ethz.ch/pipermail/r-help/2005-November/083376.html Assumed to be in the public domain.
peaks(series, span = 3, do.pad = TRUE)
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 series? Default = TRUE. |
a logical vector, TRUE for each peak
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.