find_peaks | R Documentation |
Find the index of peaks in a sequence of numeric values. Peaks value should be larger than any values among the left/right shoulder. If no peaks found, function will return the index of the max number.
find_peaks(x, left_shoulder = 10000, right_shoulder = 10000)
x |
A numeric vector. |
left_shoulder |
A integer value. Peaks value should larger than any value in the left |
right_shoulder |
A integer value. Peaks value should larger than any value in the right |
A vector of the index of peaks.
x <- c(0, 1, 3, 6, 9, 12, 11, 7, 9, 5, 1, 9, 0, 1, 2) pks <- find_peaks(x, left_shoulder = 3, right_shoulder = 3) pks
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.