0

I have 2 databases:

  1. edge list,
  2. vertex list with attributes (geographical location, and category of actors)

I build a graph G from my list of edges in the database db:

G <- graph.edgelist(cbind(db.$Source,db$Target))

And I calculated centrality measures (degree, betweenness).

And I am able to get the vertex attributes from my other CSV table with all the attributes for each vertex.

But I can't find the way to give the attributes of each vertex from my vertex list to the vertex being in the edgelist (there are more vertex in my vertex list than there are in my edge list)

Therefore I can't build a final csv file with columns: vertices Id, vertices name, vertices attribute, vertices degree, vertices betweenness. I can build such a file with Id, names and degree+betweenness, but I can't find a way to give the attribute of each vertex.

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

1

In short, build your graph with the graph.data.frame() function, add the centrality measures as attributes, and then use get.data.frame() to convert it to data frame(s) again.

Gabor Csardi
  • 10,705
  • 1
  • 36
  • 53