A simple randomizer, provides equal probability of assignment to one of many groups
rnd_assign(x, k, seed)
x | a Vector to assign |
---|---|
k | Number of groups to assign |
seed | A seed for random assignment reproducibility |
An array with x, k assignment groups, and the seed as an attribute
#> # A tibble: 100 x 2 #> id group #> <int> <chr> #> 1 1 a #> 2 2 b #> 3 3 b #> 4 4 b #> 5 5 b #> 6 6 b #> 7 7 a #> 8 8 b #> 9 9 b #> 10 10 a #> # … with 90 more rows