dichotomixed: Dichotomizes the factor variables in a mixed format data frame
Description
Dichotomizes the factor variables in a data frame composed of mixed format variables, i.e. transforms the factors into an indicator matrix (also known as disjunctive table) and keeps the numerical variables.
Usage
dichotomixed(data, out = "numeric")
Value
Returns a data frame with numerical variables and dichotomized factor variables
Arguments
data
data frame of categorical and numerical variables
out
character string defining the format for dichotomized variables in the output data frame. Format may be "numeric" (default) or "factor".
## Dichotomizes Music example data framedata(Music)
## recodes Age as numerical, for the sake of the exampleMusic$Age <- as.numeric(Music$Age)
## dichotomizationdic <- dichotomixed(Music)
str(dic)