| graph2amat | R Documentation |
Convert graphNEL object to adjacency matrix
graph2amat(graph, toFrom = TRUE, type = "pdag")
graph |
A graphNEL object. |
toFrom |
Logical indicating whether the resulting adjancency matrix is "to-from" (default), or "from-to", see details. |
type |
The type of adjancency matrix, must be one of |
A "to-from" pdag adjacency matrix is encoded as follows: A(i,j) = 1 and A(j,i) = 0
means there is an edge i -> j. A(j,i) = 1 and A(i,j) = 0 means there is an edge j -> i.
A(i,j) = 1 and A(j,i) = 1 means there is an undirected edge between i and j, i - j.
A(i,j) = 0 and A(j,i) = 0 means there is no edge between i and j.
A "from-to" adjacency matrix is the transpose of a "to-from" adjacency matrix.
A "from-to" pdag adjacency matrix is hence encoded as follows: A(i,j) = 1 and A(j,i) = 0
means there is an edge j -> i. A(j,i) = 1 and A(i,j) = 0 means there is an edge i -> j.
A(i,j) = 1 and A(j,i) = 1 means there is an undirected edge between i and j, i - j.
A(i,j) = 0 and A(j,i) = 0 means there is no edge between i and j.
See amat for details about how an ag adjacency matrix is encoded.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.