dummy | R Documentation |
The normal way to store cathegorical variables in R is to use factors, each modality being a level of this factor. Sometimes however, is is more convenient to use a set of dummy variables.
dummy(x, ..., keep = FALSE, prefix = NULL, ref = FALSE)
x |
a data frame |
... |
series of the data frame, should be factors |
keep |
a boolean, if |
prefix |
an optional prefix for the names of the computed dummies, |
ref |
a boolean, if |
a data frame
charitable %>% dummy(religion, education)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.