r_dummy: Generate Random Dummy Values

Description Usage Arguments Value See Also Examples

View source: R/r_dummy.R

Description

Generate random values from a wakefield variable function.

Usage

1
r_dummy(fun, n, ..., prefix = FALSE, rep.sep = "_")

Arguments

fun

A wakefield variable function.

n

The number of rows to produce.

prefix

logical. If TRUE the original factor name (supplied to fun as name argument) will prefix the column names that were generated from the factor's categories.

rep.sep

A separator to use for the variable and category part of names when prefix = TRUE. For example if the age is used (r_dummy(sex)), this results in column names c("Sex_Male", "Sex_Female").

...

Additional arguments passed to fun.

Value

Returns a tbl_df.

See Also

r_list, r_data_frame, r_series

Examples

1
2
3
r_dummy(sex, 10)
r_dummy(race, 1000)
r_dummy(race, 1000, name = "Ethnicity")

wakefield documentation built on Sept. 14, 2020, 1:07 a.m.