Randomly shuffle runs of 0s & 1s in a vector. Do not maintain the alternating order of 0s & 1s. We assume that the vector consists of 0s & 1s.

shuffBlockVec(x)

Arguments

x

a numeric vector

Value

a numeric vector

Examples

library(ARCOS)
set.seed(7)
x <- round(runif(20))
ARCOS:::shuffBlockVec(x)
#>  [1] 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1