I used the igraph library installed in R software and I want to extract an ego-network from the network "Les Miserables".
Here is my code:
library("igraph")
lesmis<-read.graph("lesmis.gml", format="gml")
gavroche <- graph.neighborhood(lesmis, order = 2, nodes = which(V(lesmis)$label == "Gavroche"))
wc<-infomap.community(gavroche)
plot(wc, gavroche)
I get this error :
Error in infomap.community(gavroche) : Not a graph object
here is the link of the gml file : http://www-personal.umich.edu/~mejn/netdata/lesmis.zip
graph.neighborhoodreturns a list of graphs, always, so you need to extract the first (and only) element. - Gabor Csardi