rnd_assign: rnd_assign: Randomly assign one unit into one of K groups

Description Usage Arguments Value Examples

View source: R/rnd_assign.R

Description

A simple randomizer, provides equal probability of assignment to one of many groups

Usage

1
rnd_assign(x, k, seed)

Arguments

x

a Vector to assign

k

Number of groups to assign

seed

A seed for random assignment reproducibility

Value

An array with x, k assignment groups, and the seed as an attribute

Examples

1
2
3
require(jumble)
x <- 1:100
rnd_assign(x, 2, as.integer(as.Date('2016-01-01')))

kmcconeghy/jumble documentation built on Jan. 8, 2020, 8:52 a.m.