igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Writing Pajek and graphml files


From: Thomas Barnum
Subject: [igraph] Writing Pajek and graphml files
Date: Sun, 24 Mar 2013 10:01:43 -0700

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]