mx_dummies {tidySEM} | R Documentation |
Dummy Code Factor Variables
Description
For each variable v that inherits
factor
, create a number of new variables equal
to levels(v)
to indicate group membership (1)
or non-membership (0) of that level.
The resulting dummies have class mxFactor
.
Usage
mx_dummies(x, classes = c("factor", "character"), ...)
Arguments
x |
An object for which a method exists. |
classes |
Character vector, indicating which classes to dummy code.
Defaults to |
... |
Arguments |
Value
A data.frame
.
Examples
mx_dummies(iris[1:5,])
[Package tidySEM version 0.2.7 Index]