compute_metrics: compute network metrics

View source: R/compute_metrics.R

compute_metricsR Documentation

compute network metrics

Description

Function to compute (some) network metrics on the metaweb and local networks

Usage

compute_metrics(metanetwork, res = NULL)

Arguments

metanetwork

object of class 'metanetwork'

res

a vector containing the resolutions at which the metrics are computed

Details

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.

Value

a data.frame

References

  • 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.

See Also

compute_TL(),compute_div()

Examples

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")


MarcOhlmann/metanetwork documentation built on July 1, 2023, 6:27 a.m.