I have a bipartite network consisting on users and books. Edges between the two have a "Rating" attribute which is a value between 1-10. I want to create a "Average Rating" attribute for each node, so I know a books average rating and a users average rating given.
Asked
Active
Viewed 118 times
0
-
Use `strength` to find the weighted degree centrality for each node and then divide by to number of edges each node has using `degree`. If g is your graph: `V(g)$avgrating <- strength(g, weights = rating)/degree(g)`. – paqmo Nov 12 '16 at 20:06
-
Please give a reproducible example http://stackoverflow.com/help/mcve – Hack-R Nov 12 '16 at 20:13