View source: R/calcTopologicalIndices.r

calc_topological_roles | R Documentation |

Topological roles characterize species as its roles between communities or modules, we calculate the modules using
`igraph::cluster_spinglass()`

function. Alternatively you can pass a community object obtained with other method using the
parameter `community`

.
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, community = NULL)
```

`g` |
an Igraph object with the network |

`nsim` |
number of simulations for |

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

`community` |
a community object obtained with other method, if NULL the community is calculated with |

a data frame with two numeric fields: within_module_degree, among_module_conn

GuimerĂ , R. & Nunes Amaral, L.A. (2005). Functional cartography of complex metabolic networks. Nature, 433, 895â€“900

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. https://doi.org/10.1098/rspb.2015.1546

```
#' \dontrun{
g <- netData[[2]]
tp <- calc_topological_roles(g,nsim=10)
# using a community object
m <- cluster_walktrap(g)
tp <- calc_topological_roles(g,community=m)
}
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.