shuffBlockVecAlt: Block shuffle a binary vector

View source: R/utils.R

shuffBlockVecAltR Documentation

Block shuffle a binary vector

Description

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.

Usage

shuffBlockVecAlt(x)

Arguments

x

a numeric vector

Value

a numeric vector

Examples

library(ARCOS)
set.seed(7)
x <- round(runif(20))
ARCOS:::shuffBlockVecAlt(x)

dmattek/ARCOS documentation built on Dec. 5, 2024, 11:02 p.m.