Convert categorical variable to dummy (0/1) coding
Usage
DUMMY(x, catnames=NA)
Arguments
x
Variable (vector) of categorical data to be coded
catnames
Category names
Author
Michael Greenacre
Details
The function DUMMY takes a categorical variable and converts it to a set of dummy variables (zeros and ones), where the ones indicate the corresponding category. There are as many columns in the result as there are unique categories in the input vector.