|
From: | Gábor Csárdi |
Subject: | Re: [igraph] Writing Pajek and graphml files |
Date: | Sun, 24 Mar 2013 17:04:38 -0400 |
Dear All,
I am trying to export a Pajek file and a graphml file to be opened in gephi. However, when I open the file in gephi, all the graph attributes (vertex names, vertex colors, and edge colors) are not recognized by gephi. I dropped the graphml file into Firefox and Firefox states that there does not appear to be style information associated with the file (for example, nodes are listed as 'n1' instead of by letters).
Here is some workable code that reproduces the problem:
### I want to export two different colored edges in the final graph so this code uses two colors for the edges
foo<-graph.ring(10)
E(foo)$color[1:5]<-"blue"
E(foo)$color[6:10]<-"green"
V(foo)$name <- LETTERS[1:10]
plot(foo, vertex.label=V(foo)$name)
write.graph(foo, format="pajek", file="test.net")
write.graph(foo, format="graphml", file="test.graphml")
I feel like I am missing something really obvious here, particularly in regards to the Pajek format, but I can't figure it out. I have tried including some attributes when I write the Pajek file. For example:
write.graph(foo, format="pajek", file="test.net", foo$color("blue","green"))
or
write.graph(foo, format="pajek", file="test.net", foo$c("blue","green"))
but I get this error message:
Error in write.graph.pajek(graph, file, ...) : attempt to apply non-function
Any ideas/help/suggestions will be greatly appreciated.
All the best,
Tom
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |