Description Usage Arguments Value Examples
Find Peaks in a timeseries. Credit: https://github.com/stas-g
1 | find_peaks(x, m = 3)
|
x |
|
m |
|
(numeric) |
A numeric vector of exact indices of peaks. |
Note: this differs from quantmod::findPeaks
in that is supplies the indices of the exact peaks, whereas quantmod supplies the vector of indices lagged by one time unit - useful when selling a stock but not if you want to know the exact peak locations.
1 2 | dat <- data.frame(y = rnorm(15,0,1),x = {rnorm(15,0,1) + rnorm(15,0,.02)})
apply(dat, 2, find_peaks)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.