These functions provide coercions between objects that inherit from
graph class to sparse matrices from the
An instance of the
A logical value indicating whether to use the edge weights in the graph as values in the sparse matrix.
A sparse matrix.
Specifies whether the graph to be created should have
directed (default) or undirected edges. If undirected, the input
A very simple coercion from one representation to another.
Currently it is presumed that the matrix is square. For other graph formats, such as bipartite graphs, some improvements will be needed; patches are welcome.
graph2SparseM takes as input an instance of a subclass of the
graph class and returns a sparse matrix.
sparseM2Graph takes a sparse matrix as input and returns an
instance of the
graphNEL class. By default, the
graphNEL returned will have directed edges.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.