mutate_dummy | R Documentation |
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'.
mutate_dummy(df, var)
df |
A dataframe. |
var |
A categorical variable in 'df'. |
A dataframe with additional columns for the dummy variables.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.