Description Usage Arguments Value Author(s) Examples

Functions to find the peaks (tops) and valleys (bottoms) of a given series.

1 2 | ```
findPeaks(x, thresh=0)
findValleys(x, thresh=0)
``` |

`x` |
a time series or vector |

`thresh` |
minimum peak/valley threshold |

A vector of integers corresponding to peaks/valleys.

As a peak[valley] is defined as the highest[lowest] value in a series,
the function can only define it after a change in direction
has occurred. This means that the function will always
return the first period *after* the peak/valley of the
data, so as not to accidentally induce a look-ahead bias.

Jeffrey A. Ryan

1 2 3 4 5 6 7 8 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.