How can I create an ego graph of a given vertex (igrap)

I am trying to create and build an ego network of a given vertex in a larger network. I am getting my network from a csv file containing a list of weighted edges:

art<-read.csv(file.choose("art.csv"))
g_art<-graph.data.frame(art)

      

Then I use the make_ego_graph function like this:

g_ego_art<-make_ego_graph(g_art, order=2, nodes = "PLAZA")

      

Then I try to plot the top PLAZA ego netrwork and I get this error:

plot(g_ego_art)
Error in xy.coords(x, y, xlabel, ylabel, log) : 
  'x' is a list, but does not have components 'x' and 'y'

      

Any help please? Thank!

+3


source to share


1 answer


make_ego_graph

will return a list of the ego network ... if you want to see the first one, just plot(g_ego_art[[1]])



+1


source







All Articles