简体   繁体   English

igraph:具有每个顶点集中度和每个顶点属性的csv文件

[英]igraph: csv file with centrality measures for each vertex AND attributes for each vertex

I have 2 databases: 我有2个数据库:

  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: 我从数据库db的边列表中构建了图G:

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. 而且我可以从其他CSV表中获取顶点属性以及每个顶点的所有属性。

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. 因此,我无法使用列构建最终的csv文件:顶点ID,顶点名称,顶点属性,顶点度,顶点间。 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. 我可以使用Id,名称和度+中间度构建这样的文件,但是我找不到找到每个顶点属性的方法。

简而言之,使用graph.data.frame()函数构建图形,添加中心性度量作为属性,然后使用get.data.frame()再次将其转换为数据帧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM