powered by
Create a dummy matrix based on the elements of a factor. Each column in the produced matrix is a dummy indicator.
factor_to_dummy(afactor)
A matrix of dummy variables
a factor (preferably of vectors)
Gaston Sanchez
vector_to_dummy, list_to_dummy
vector_to_dummy
list_to_dummy
# 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)
Run the code above in your browser using DataLab