as.graphNEL | R Documentation |
Converts an igraph object into an Ragraph object, preserving as many attributes of nodes and edges as possible.
as.graphNEL(G)
G |
An |
The only tricky part of the implementation is to transfer as many of
the properties of nodes and edges from one representation to another,
since the igraph
package already has a conversion function
called as_graphnel
. That version keeps tge ege
list and node list, but not the attributes. Our implementation uses
the vertex_attr
and
edge_attr
functions from igraph
to
extract the properties and then passes them to the
agopen
function in Rgraphviz
to map
them to the slightly different naes use din te output.
The function should probably be named as.Ragraph
, but we didn't
understand enough about Rgraphviz when we started.
Also, the converson will fail if the igrph input has any multiple edges, which are not supported in graphNEL objects.
An Ragraph
representation of the same graph.
Kevin R. Coombes krc@silicovore.com, Polina Bombina pbombina@augusta.edu
xmlfile <- system.file("pathways/WP3850.gpml", package = "WayFindR")
G <- GPMLtoIgraph(xmlfile)
GN <- as.graphNEL(G)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.