Learn R Programming

junco (version 0.1.2)

h_get_design_mat: 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)

Value

The logical matrix with dummy encoding of all factor levels.

Arguments

df

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

.var

(string)
name of the factor variable.

Examples

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

Run the code above in your browser using DataLab