Tamas Nepusz wrote:

graph.neighborhood(g, 1, c("A", "B", "C"))

This would give you three graphs, one centered on "A", one centered on "B"
and one centered on "C". This would be returned in a list with three
elements. Since you specified only "A" for graph.neighborhood, it will
return a list of one element only, but you still need to refer to the first
element with [[1]] to get the actual graph.

> This is really convenient! So I can extract quite a number of community at
the same time, thanks!

> Moreover, do you know why graph.neighborhood(g, 1, "A") return up to 
> the 2nd level?
What makes you think that? graph.neighborhood will return the vertex and its
first-order neighbors only:

> because when I exam the file content, I find something like:

C D
C E
C F
B D
B C
A C
A B

And I expect only
A C
A B

Should be output...



_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to