mat01 | R Documentation |
Convert a list of character vectors to a matrix with i columns and j rows, where i are the list vector names and j are the unique elements found across i vectors. Cell i,j has a value of 1 if element j exists in vector i, and a value of 0 otherwise.
mat01(L)
L |
list of character vectors |
matrix of 0s and 1s with as many columns as there are vectors in the list and as many rows as there are unique elements across all vectors.
## Not run:
if(interactive()){
L = list(orig = letters, subset = sample(letters, 5))
head(mat01(L))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.