Used when equal sized groups are desired, if the cohort size is odd then it will randomly assign the odd one out to one of the groups. Currently only 2 groups.

rnd_allot(x)

Arguments

x

a Vector to assign

Value

An array with x, k assignment groups

Examples

require(jumble) x <- 1:100 rnd_allot(x)
#> # A tibble: 100 x 2 #> id group #> <int> <chr> #> 1 1 a #> 2 2 b #> 3 3 b #> 4 4 a #> 5 5 a #> 6 6 b #> 7 7 b #> 8 8 b #> 9 9 a #> 10 10 a #> # … with 90 more rows