View source: R/compute_metrics.R
compute_metrics | R Documentation |
Function to compute (some) network metrics on the metaweb and local networks
compute_metrics(metanetwork, res = NULL)
metanetwork |
object of class 'metanetwork' |
res |
a vector containing the resolutions at which the metrics are computed |
This function computes network metrics for the metaweb and local networks at the available resolutions. This function computes the following metrics:
weighted connectance: connectance weighted by abundances and link probability (see Ohlmann et al. 2019)
Denoting p_q
abundance of node q
and \pi_{ql}
the interaction probability between nodes q
and l
, then the weighted connectance C
is:
C = \sum_{q,l} \pi_{ql}p_q p_l
mean_TL and max_TL: mean and max trophic level of each network, using values computed from compute_TL() method.
mean_shortest_path_length: mean shortest path lenght of each network computed using igraph mean_distance() function.
a data.frame
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research. InterJournal, complex systems, 1695(5), 1-9.
Ohlmann, M., Miele, V., Dray, S., Chalmandrier, L., O'connor, L., & Thuiller, W. (2019). Diversity indices for ecological networks: a unifying framework using Hill numbers. Ecology letters, 22(4), 737-747.
compute_TL()
,compute_div()
library(metanetwork)
library(igraph)
#on angola dataset
data("meta_angola")
compute_metrics(meta_angola)
#computing metrics only at Phylum level
compute_metrics(meta_angola,res = "Phylum")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.