which_run | R Documentation |
min_run
calculates running which - returns index of element where x == TRUE
.
which_run(
x,
k = integer(0),
lag = integer(1),
idx = integer(0),
at = integer(0),
which = "last",
na_rm = TRUE,
na_pad = FALSE
)
x |
( |
k |
( |
lag |
( |
idx |
( |
at |
( |
which |
|
na_rm |
|
na_pad |
( |
integer vector of indexes of the same length as x
.
set.seed(11)
x1 <- sample(c(1, 2, 3), 15, replace = TRUE)
x2 <- sample(c(NA, 1, 2, 3), 15, replace = TRUE)
k <- sample(1:4, 15, replace = TRUE)
which_run(x1)
which_run(x2, na_rm = TRUE)
which_run(x2, na_rm = TRUE, k = 4)
which_run(x2, na_rm = FALSE, k = k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.