get_runs | R Documentation |
Identify the length of runs (of values TRUE) and their frequencies.
get_runs(x)
x |
Boolean vector |
a table of the number of runs of TRUEs
x <- rbinom(100, size = 1, prob = 1 / 3)
get_runs(x == 1) # expected value for longest run is 3
get_runs(x == 0) # expected value for longest run is 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.