View source: R/sequence_characteristics.R
max_duration | R Documentation |
Determine the length of the (first) longest run
max_duration(x, target_val = 1L, return_doys = FALSE)
x |
A vector. |
target_val |
A value. Runs of |
return_doys |
A logical value. |
A numeric vector with one or three elements including
the length of the longest run of value target_val
(the first if multiple runs are of equally the longest) and,
if return_doys == TRUE
, then the start and end
position of that longest run.
max_duration(0, target_val = 1)
x <- c(rep(3, 3), rep(10, 10), 4, rep(10, 20), rep(3, 6))
max_duration(x, 10, FALSE)
max_duration(x, 10, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.