This recipe covers the methods used to compute some of the common metrics used on social networks.
If you have not yet installed the
igraph package, do it now. If you worked through the earlier recipes in this chapter, you should have the data files
bipartite-graph.Rdata and should ensure that they are in your R working directory. If not, you should download these data files and place them in your R working directory.
To compute important network metrics, follow these steps:
> load("undirected-graph.Rdata") > load("directed-graph.Rdata") > load("bipartite-graph.Rdata")
degreecentrality can be measured as follows: ...