Re: [R] igraph plot - vertex colors

2009-12-08 Thread Jakson A. Aquino
On Sun, Dec 06, 2009 at 04:34:18PM -0800, Brock Tibert wrote:
> I have successfully created and analyzed my network data.  I am
> new to R, and Network Analysis too, but I want to color my
> vertex based on some of the centrality measures calculated.  
> 
> Can someone point me in the right direction? Again, I am new to
> R, but given how powerful R appears to be, I figure this is
> probably pretty easy to do, I just wish I could figure it out.

Below is an example of how to do it. Suppose you have a igraph
object called g:

hc5 <- heat.colors(5)
g.bet <- betweenness(g)
g.bet.max <- max(g.bet)
vcolors <- 5 - round(4 *(g.bet / g.bet.max))
vcolors <- hc5[vcolors]
plot(g, vertex.color=vcolors, main = "Betweenness")

-- 
Jakson

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] igraph plot - vertex colors

2009-12-06 Thread Brock Tibert
Hi everyone,

I have successfully created and analyzed my network data.  I am new to R, and 
Network Analysis too, but I want to color my vertex based on some of the 
centrality measures calculated.  

Can someone point me in the right direction? Again, I am new to R, but given 
how powerful R appears to be, I figure this is probably pretty easy to do, I 
just wish I could figure it out.

Many thanks in advance,

Brock

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.