new_variable: Create a uniform categorical random variable.

Description Usage Arguments Value Examples

Description

The sampling for the items of the created variable is done with replacement.

Usage

1
new_variable(elements, n)

Arguments

elements

A vector with the elements from which to choose to create the variable.

n

An integer indicating the number of items to be contained in the variable.

Value

A factor that represents a uniform categorical variable.

Examples

1
2
new_variable(c(0,1), 4)
new_variable(c('a','b','c'), 10)

eliasmacielr/msu documentation built on May 21, 2019, 3:03 a.m.