Reputation: 195
Hi I am having a problem where i want to make a network of user based on articles in a data frame named "wiki" like Faid users1 users2 ( Faid= articles), users1= network node,users2= network node) 1 a1 u1 1 a1 a2 . a1 b2 . u1 a2 . u1 b2 1 a2 b2
2 a1 c1 . a1 a2 . a1 c2 . c1 a2 . c1 c2 2 a2 c2
3 c2 c1 . c2 u2 . c2 u1 . c1 u2 . c1 u1 3 u2 u1
this is just a an example I have more than 3000 article's user networks .
what I want is to find the degree centrality scor for each user in a whole network( in all article) and shows the score in a column where (Faid 1 )have a centrality score of a user with highest degree centrality score and (Faid 2) have the highest degree centrality score .
but the score should be of a user that belong to the network of that article. e.g
users centrality_score
a1 100
a2 80
b1 70
b2 55
c1 10
c2 50
u1 140
u2 15
and the final dataframe would look like this
Faid centrality score
1 140 (# i.e. u1 has 140)
2 100
3 140
this is just an example of the data I have and the results I want. any help would highly be appreciated. thanks
Upvotes: 0
Views: 425
Reputation: 26
You might try the igraph-package to generate a graph:
http://igraph.org/r/ and the function centralization.degree. Use get.data.frame to generate a graph from a data frame.
All the best Hermann
Upvotes: 1