shuffBlockVecAlt | R Documentation |
Randomly shuffle runs of 0s & 1s in a vector but maintain their alternating order, i.e. there'll never be joint runs of 0s or 1s from the original sequence. We assume that the vector consists of 0s & 1s.
shuffBlockVecAlt(x)
x |
a numeric vector |
a numeric vector
library(ARCOS)
set.seed(7)
x <- round(runif(20))
ARCOS:::shuffBlockVecAlt(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.