[R] Questons about 'igraph' package

karena dr.jzhou at gmail.com
Thu Sep 15 01:11:21 CEST 2011


Hi,

I am using 'igraph' to make some plots. The problem I got is that I don't
know how to label the nodes with gene names.

My sample code:

## suppose I have 100 gene (nodes) ##
---------------------------------------------------------------------------
graph <- set.vertex.attribute(graph, "color",
value=c(rep(c('green','red'),50)))
graph <- set.vertex.attribute(graph, "name", value=genelist)
tkplot(graph)
----------------------------------------------------------------------------
The 'color' attribute does work, the nodes are red and green, but the 'name'
attribute doesn't work, I still have the numeric id on each node (0-99).

Can anyone tell me how to solve this problem?

Thank you,

Karena

--
View this message in context: http://r.789695.n4.nabble.com/Questons-about-igraph-package-tp3814338p3814338.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list