igraph-help
[Top][All Lists]

## Re: [igraph] question about itereted operations and egonetworks

 From: Gábor Csárdi Subject: Re: [igraph] question about itereted operations and egonetworks Date: Wed, 17 Apr 2013 22:48:36 -0400

Hi Umberto,

On Tue, Apr 16, 2013 at 11:36 AM, Umberto77 wrote:
[...]
The problem is that using graph.neighborhood I get an output like this:

[[65]]
IGRAPH DN-- 6 15 --
+ attr: name (v/c), value (e/n)

[[66]]
IGRAPH DN-- 3 2 --
+ attr: name (v/c), value (e/n)

What kind of output would you like?

where egos in my list are identified by a number in squared brackets. Since I need to work on a time series, I need to keep trace of the name of the egos, so that to build an egonetwork density time series for each of my nodes across 10 years.

If you want a named list as the output, just add the vertex of the original graph to the result list:
names(result) <- V(originalgraph)\$name

As for "graph.density" it calculates density as ratio between number of ties and all the possible ties in the (ego)network, while I need to calculate it as number of ties over number of pairs. I was wondering if there's a direct function to perform it in place of "graph.density".

What exactly is the difference? Isn't "all possible ties" the same as the number of pairs (ordered or unordered, depending on whether your graph is directed)?

[...]
What if I create a list of networks, including all my 10 years, and than use "lapply" for "graph.neighborhood" and than for "graph.density"?

I am not sure what is the question here. If you would like to do this, just go ahead. :)

Best,
Gabor

[...]