list2mat | R Documentation |
First-level list must have vectors of basic data types defined by R such as
characater
, integer
, number
, and logical
.The
function transforms such a list into adjacency matrix, rows of which are
vector elements and columns of which are names of the list.
list2mat(list)
list |
A one-level list. See details |
An adjacency matrix. Row and column names are defined by unique elements and list names, respectively.
Jitao David Zhang <jitao_david.zhang@roche.com>
testList <- list(HSV=c("Adler", "Westermann", "Jansen"), FCB=c("Robben",
"Jansen", "Neuer"), S04=c("Westermann", "Neuer"))
list2mat(testList)
testList2 <- list(c("A", "B", "C"), c("B", "C", "D"), c("D", "E", "F"))
list2mat(testList2)
testList3 <- list(Worker1=0:8L, Worker2=5:13L, Worker3=8:16L, Worker4=16:24L)
list2mat(testList3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.