Tamas Nepusz wrote:
> g <- graph.famous("petersen")
> V(g)$name <- LETTERS[1:10]
> graph.list <- graph.neighborhood(g, 1, "A")
> g2 <- graph.list[[1]]
> V(g2)$name
[1] "A" "B" "E" "F"> write.graph(g, "edgelist.txt",format="edgelist") so I will obtain some > resultant files like: The "edgelist" format uses the numeric vertex IDs, not the names. Use the "ncol" format instead if you want to print the names. Thanks Tamas Nepusz. Following your suggestions let me proceed to get 2 levels of nearest neighbor. In fact I don't quite get the usage of [[]] and the "1" inside the bracket (first element in an array?), and it's difficult to google by using [[]], would you please refer me for further reference? Moreover, do you know why graph.neighborhood(g, 1, "A") return up to the 2nd level? I try graph.neighborhood(g, 0, "A") but it doesn't work... _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
