calc_topological_roles: Calc topological roles among network communities/modules

View source: R/calcTopologicalIndices.r

calc_topological_rolesR Documentation

Calc topological roles among network communities/modules


Topological roles characterize species as its roles between communities or modules, we calculate the modules using the igraph::cluster_spinglass() function. Topological roles are described by two parameters: the standardized within-module degree dz and the among-module connectivity participation coefficient PC. The within-module degree is a z-score that measures how well a species is connected to other species within its own module compared with a random graph. The participation coefficient PC estimates the distribution of the links of species among modules. As the community algorithm is stochastic we run it several times and return the repeated runs for both parameters.


calc_topological_roles(g, nsim = 1000, ncores = 0)



an Igraph object with the network


number of simulations with different community


number of cores to use paralell computation, if 0 sequential processing is used.


a data frame with two numeric fields: within_module_degree, among_module_conn


  1. Guimerà, R. & Nunes Amaral, L.A. (2005). Functional cartography of complex metabolic networks. Nature, 433, 895–900

  2. Kortsch, S. et al. 2015. Climate change alters the structure of arctic marine food webs due to poleward shifts of boreal generalists. - Proceedings of the Royal Society B: Biological Sciences 282: 20151546.


#' \dontrun{

g <- netData[[2]]

tp <- calc_topological_roles(g,nsim=10)


lsaravia/EcoNetwork documentation built on Feb. 27, 2023, 6:43 a.m.