igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] retrieve edge attribute


From: Tamás Nepusz
Subject: Re: [igraph] retrieve edge attribute
Date: Mon, 14 May 2012 11:58:49 +0200

> I'd like to set the size of node proportionally to the mean value of
> the importance that is given to a node by its neighborhood. I am on R
> with igraph 0.5.5-4.
> 
> How to retrieve the importance value of the in-links of a node?
Try this:

al <- get.adjlist(g, mode="in")
V(g)$size <- unlist(lapply(al, function (vs) { mean(V(g)$importance[vs+1] }))

Note the +1 in the indexing, which accounts for the zero-based igraph vertex 
indices.

Best,
T.






reply via email to

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