View source: R/compute_diversities.R
compute_div | R Documentation |
Function to compute network diversity indices based on Hill numbers following the method described in Ohlmann et al. 2019
compute_div(metanetwork, q = 1, res = NULL)
metanetwork |
object of class 'metanetwork' |
q |
viewpoint parameter controlling the weight given to abundant species/groups and links, default is 1 |
res |
a vector containing the resolutions at which the diversities are computed |
This function compute diversity indices using Hill numbers on node and link abundances. Importantly, a viewpoint parameters q
allows giving more weigth to abundant nodes/links. Given a network, we note p_q
the abundance of node q
(stored as node attribute ab
) and \pi_{ql}
interaction probability between nodes q
and l
(stored as edge attribute weight
). The link abundance L_{ql}
between nodes
q
and l
is then:
L_{ql} = \pi_{ql}p_q p_l
Node diversity (for q = 1
) is then computed as:
D(p) = \exp (\sum_q - p_q \log p_q)
Link diversity is computed as:
D(L) = \exp (\sum_{ql} - \frac{L_{ql}}{C} \log L_{ql}{C})
where C
is the weighted connectance
C = \sum_{ql} \pi_{ql}p_q p_l
The overall \alpha
-diversity in node abundances is (for q = 1
):
A_{P} = \exp(\sum_{q=1}^{Q} \sum_{k} - \frac{P_{qk}}{P_{++}} \log(\frac{P_{qk}}{P_{++}}) - \log(K))
The overall \alpha
-diversity in node abundances is (for q = 1
):
A_{P} = exp(\sum_{q=1}^{Q} \sum_{k=1}^{K} - \frac{P_{qk}}{P_{++}} log ( \frac{P_{qk}}{P_{++}}) - log(K) )
where P_{++}=\sum_{k} \sum_{q} P_{qk}
The overall \alpha
-diversities in link abundances and link probabilities are equal to:
A_{L} = exp (\sum_{q,l=1}^{Q} \sum_{k=1}^{K} - \frac{L_{qlk}}{L_{+++}} \log (\frac{L_{qlk}}{L_{+++}}) - log(K))
where L_{+++}=\sum_{k} \sum_{q,l} L_{qlk}
.
The \gamma
-diversity in node and link abundances are (for q = 1
):
G_{P}=exp(\sum_{q=1}^{Q} -\frac{P_{q+}}{P_{++}} log (\frac{P_{q+}}{P_{++}}))
G_{L}=exp(\sum_{q,l=1}^{Q} -\frac{L_{ql+}}{L_{+++}} log(\frac{L_{ql+}}{L_{+++}}))
The \beta
-diversity is then defined in a multiplicative way:
B_{P}=\frac{G_P}{A_P}
B_{L}=\frac{G_P}{A_L}
For more details on \alpha
-,\beta
- and \gamma
-diversity, see Ohlmann et al. 2019.
a data.frame
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_dis()
library(metanetwork)
library(igraph)
#on angola dataset
data("meta_angola")
compute_div(meta_angola,q = 1)
#computing diversities only at Phylum level
compute_div(meta_angola,q = 1,res = "Phylum")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.