get_longest_run | R Documentation |
Identifies the length of the longest run of TRUEs in Boolean vector x
.
used to be maxCMS
get_longest_run(x)
x |
Boolean vector |
an integer value of the length of the longest run of TRUE values
x <- rbinom(100, size = 1, prob = 1 / 3)
get_runs(x == 1) # expected value for longest match is 3
get_longest_run(x == 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.