construct_indicators: Expand Factor Variable into Indicators

Description Usage Arguments Value

View source: R/compute_quant.R

Description

construct_indicators takes a factor variable with k levels contained in a data.frame and expands it into a k-column data.frame of indicator variables for each of the levels. Primarily a helper function for magic_table_categorical.

Usage

1
construct_indicators(var_name, dataset)

Arguments

var_name

a character string or vector containing the name(s) of the factor variable(s).

dataset

a data.frame object containing var_name.

Value

a data.frame containing the expanded factor variable.


Scott-Coggeshall/magictable documentation built on July 30, 2020, 2:19 a.m.