Skip to contents

The `var` column is a categorical variable which may be expressed in terms of `length(unique(df$var))` columns with levels zero or one using `model.matrix`.

Usage

mutate_dummy(df, var)

Arguments

df

A dataframe.

var

A categorical variable in `df`.

Value

A dataframe with additional columns for the dummy variables.