runs | R Documentation |
TRUE
-runsCalculate positional information about TRUE
-runs
calc_starts(x)
calc_runs(x)
x |
A vector. Values are coerced to logical values. |
For calc_starts()
:
an integer vector with start position(s) of TRUE
-runs.
For calc_runs()
:
a list with integer sequences of the position(s) of TRUE
-runs.
calc_starts(c(0, 1, 1, 0, 0)) ## expected: 2
calc_runs(c(0, 1, 1, 0, 0)) ## expected: list(2:3)
calc_starts(c(1, 1, 0, 0)) ## expected: 1
calc_runs(c(1, 1, 0, 0)) ## expected: list(1:2)
calc_starts(c(1, 1, 0, 0, 1, 1)) ## expected: 1 5
calc_runs(c(1, 1, 0, 0, 1, 1)) ## expected: list(1:2, 5:6)
calc_starts(c(1.5, 2, 0, 0, 15, 3.5)) ## expected: 1 5
calc_runs(c(1.5, 2, 0, 0, 15, 3.5)) ## expected: list(1:2, 5:6)
calc_starts(c(0, 0)) ## expected: integer(0)
calc_runs(c(0, 0)) ## expected: list()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.