matrix2graph {threejs} | R Documentation |
graphjs
.Convert a matrix or column-sparse matrix to a list of edges and nodes for
use by graphjs
.
matrix2graph(M)
M |
either a matrix or any of the possible column sparse matrix objects from the Matrix package. |
A list with node and edges data frame entries used by graphjs
.
Numeric graphs are assumed to be weighted and the edge "size" values are set to the corresponding matrix entries.
data(LeMis) M <- graph2Matrix(LeMis$edges, LeMis$nodes) G <- matrix2graph(M)