h_get_design_mat {junco}R Documentation

Helper Function to Create Logical Design Matrix from Factor Variable

Description

Helper Function to Create Logical Design Matrix from Factor Variable

Usage

h_get_design_mat(df, .var)

Arguments

df

(data.frame)
including a factor variable with name in .var.

.var

(string)
name of the factor variable.

Value

The logical matrix with dummy encoding of all factor levels.

Examples

h_get_design_mat(df = data.frame(a = factor(c("a", "b", "a"))), .var = "a")

[Package junco version 0.1.1 Index]