Description Usage Arguments Value Author(s) See Also Examples
View source: R/list_to_dummy.r
Create a dummy matrix based on the elements of a list. Each column in the produced matrix is a dummy indicator.
1 |
alist |
a list of vectors |
A matrix of dummy variables
Gaston Sanchez
1 2 3 4 5 6 7 8 9 | # let's say you have a list like this
num_list = list(1:3, 4:5, 6:9)
# get dummy matrix
list_to_dummy(num_list)
# try with a list of strings
str_list = list(c("a","b","c"), c("d", "e"), c("f","g","h"))
list_to_dummy(str_list)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.