You can convert an igraph object to a dataframe in R using the as.data.frame() function. However, to replace the node numbers with node names, you need to specify the vertices and edges attributes of the igraph object.
Here is a sample code:
main.r571 chars25 lines
This will output:
main.r142 chars6 lines
Note that this code assumes that the vertex names are stored in the name attribute of the igraph object. You may need to adjust the code if your vertex names are stored in a different attribute.
gistlibby LogSnag