rfactor {groupedHyperframe.random}R Documentation

Generate Random factor

Description

..

Usage

rfactor(n, prob, levels = as.character(seq_along(prob)))

Arguments

n

integer scalar

prob

numeric vector, see function sample.int

levels

character vector, see function factor

Value

Function rfactor() returns a factor

Examples

rfactor(n = 100L, prob = c(4,2,3))
rfactor(n = 100L, prob = c(4,2,3), levels = letters[1:3])

[Package groupedHyperframe.random version 0.1.0 Index]