mark_last_peak | R Documentation |
Mark the location of the last maximum value in a vector
mark_last_peak(vec, threshold = NULL)
vec |
(Numeric) A vector. |
threshold |
(Numeric or NULL) The smallest acceptable peak value. NULL means no threshold. |
A bool vector of the same length as vec
, with the last maximum marked with
a TRUE.
Desi Quintans (http://www.desiquintans.com)
input <- c(1, 2, 3, 3, 1)
mark_last_peak(input, threshold = NULL)
#> [1] FALSE FALSE FALSE TRUE FALSE
mark_last_peak(input, threshold = 4)
#> [1] FALSE FALSE FALSE FALSE FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.