Reputation: 861
I'm wanting to output all edges in a iGraph g to an XML file, which looks something like this:
<edges>
<edge from="1" to "2" />
<edge from="1" to "4" />
...
</edges>
I know I can get the list of edges using E(g), but I don't know how to grab each individual to and from for each edge to output to XML.
Also, I have set the name attribute for all vertices, and need to output their name---not their id.
Could someone give my some advice.
Thanks.
Upvotes: 1
Views: 547
Reputation: 40126
Check out ?write.graph
within R. The igraph
package can export graph objects to a variety of formats.
Upvotes: 2