GenerateFactorData {Boom} | R Documentation |
Generate a data frame of all factor data
Description
This function is mainly intended for example code and unit
testing. It generates a data.frame
containing all factor data.
Usage
GenerateFactorData(factor.levels.list, sample.size)
Arguments
factor.levels.list |
A list of character vectors giving factor level names. The names attribute of this list becomes the set of variables names for the return data frame. |
sample.size |
The desired number of rows in the returned data frame. |
Author(s)
Steven L. Scott steve.the.bayesian@gmail.com
Examples
foo <- GenerateFactorData(list(a = c("foo", "bar", "baz"),
b = c("larry", "moe", "curly", "shemp")),
50)
head(foo)
# a b
# 1 bar curly
# 2 foo curly
# 3 bar moe
# 4 bar moe
# 5 baz curly
# 6 bar curly
[Package Boom version 0.9.15 Index]