Function to calculate weighted network indices
Source:R/calcFunctionalIndices.r
calc_weighted_topological_indices.RdThis function calculates weighted topological indices for ecological networks, including:
weighted linkage density, connectance, generality and vulnerability and the SDs of the last two based on [1]
and the level of omnivory, mean and maximum trophic level based on [2] using NetIndices::TrophInd() function.
The igraph networks must have the weight attribute.
Value
a data.frame with the following fields:
LD: linkage density
Connectance: directed Connectance
TLmean: mean trophic level
TLmax: maximum trophic level
LOmnivory: Level of omnivory, quantifies mean of the variety in trophic levels of the preys of a consumer
Vulnerability: mean of number of consumers per prey
VulSD: the standard deviation of normalized Vulnerability
Generality: mean number of prey per consumer
GenSD: the standard deviation of normalized Generality
References
Bersier, LF. et al. (2002). Quantitative Descriptors Of Food-web Matrices. Ecology, 83(9), 2394–2407.
Kones, JK. et al. (2009). Are network indices robust indicators of food web functioning? A Monte Carlo approach. Ecological Modelling, 220, 370–382.
Examples
# Generate a test network
g <- graph_from_literal( 1 -+ 4 -+ 7,2 -+ 5 -+7, 3-+6-+7, 7-+7, 4+-3, simplify = FALSE)
# Add weight
E(g)$weight <- sample(c(.1,.2,.8,.9),gsize(g),replace=TRUE)
calc_weighted_topological_indices(g)
#> wLD wConnectance wTLmean wTLmax wLOmnivory wVulnerability wVulSD
#> 1 1.839137 0.2627338 1.626374 2.384615 0.08140971 1.083482 0.5894277
#> wGenerality wGenSD
#> 1 2.594791 2.067256