Description Usage Arguments Value Author(s) See Also Examples
View source: R/factor_to_dummy.r
Create a dummy matrix based on the elements of a factor. Each column in the produced matrix is a dummy indicator.
1 | factor_to_dummy(afactor)
|
afactor |
a factor (preferably of vectors) |
A matrix of dummy variables
Gaston Sanchez
vector_to_dummy
,
list_to_dummy
1 2 3 4 5 | # let's say you have a list like this
some_factor = iris$Species[c(1:3,51:53,101:103)]
# get dummy matrix
factor_to_dummy(some_factor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.