dummy | R Documentation |
This function applies dummy-coding to a variable of interest, enabling the creation of n or n-1 columns/variables based on n number of attributes for the variable.
dummy(df, var, remove = FALSE)
df |
data frame to read in. |
var |
the variable to be dummy-coded. Is automatically converted to a character string. |
remove |
logical (default set to |
This function updates the data frame with new variables (columns) representing unique values of a selected variable, and a binary score (0/1) for the absence or presence of a column's represented value for each observation.
data <- howell_aids_long
dummy(data, student)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.