Learn R Programming

threejs (version 0.2.2)

matrix2graph: Convert a matrix or column-sparse matrix to a list of edges and nodes for use by graphjs.

Description

Convert a matrix or column-sparse matrix to a list of edges and nodes for use by graphjs.

Usage

matrix2graph(M)

Arguments

M

either a matrix or any of the possible column sparse matrix objects from the Matrix package.

Value

A list with node and edges data frame entries used by graphjs.

See Also

graphjs, graph2Matrix

Examples

Run this code
# NOT RUN {
data(LeMis)
M <- graph2Matrix(LeMis$edges, LeMis$nodes)
G <- matrix2graph(M)
# }

Run the code above in your browser using DataLab