View source: R/modalities_functions.R
colToDummies | R Documentation |
Changes a column containing multiple values to a matrix of columns containing the dummies corresponding to each value.
colToDummies(col, nameCol, modalities = NULL, keepValue = FALSE)
col |
input column |
nameCol |
name that will be used as a prefix for dummies column name in the output matrix |
modalities |
if a vector is entered, dummies produced will only be the ones corresponding to the values in the "modalities" input column + another one containing all the other modalities. |
keepValue |
Logical. If TRUE, puts not "1"s in the dummies output columns but the real values in the "col" column (except if values are non-numeric) |
Matrix containing the dummy columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.