dummy.code | R Documentation |
Converts a factor (categorical) variable to a matrix of dummy codes using a 1 of C-1 binary coding scheme.
dummy.code(x)
x |
a factor variable. |
a matrix with the number of rows equal to the number of cases in x
and the number of columns equal to one minus the number of factors in
x
. The last factor serves as the reference group.
print(dummy.code(iris$Species))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.