Skip to contents

Calculate topological indices for ecological networks. The mean trophic level and Omnivory and the Level of omnivory are calculated with the function NetIndices::TrophInd()

Usage

calc_topological_indices(ig, ncores = 0)

Arguments

ig

vector of igraph objects

ncores

number of cores used to compute in parallel, if 0 sequential processing is used.

Value

a data.frame with the following fields:

  • Network: Name of the network if the list have names

  • Size: Number of species

  • Top: Number of top predator species

  • Basal: Number of basal especies

  • Omnivory: Proportion of omnivorous species

  • Links: number of interactions

  • LD: linkage density

  • Connectance: directed Connectance

  • PathLength: average path length

  • Clustering: clustering coeficient

  • Cannib: number of cannibalistic species

  • 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

  • Components: number of weakly connected components

  • 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

Examples


calc_topological_indices(netData)
#>               Network Size Top Basal  Omnivory Links        LD Connectance
#> 1              Angola   28   4     2 0.7500000   127  4.535714 0.161989796
#> 2          Baltic Sea   33   4     4 0.4848485   191  5.787879 0.175390266
#> 3  Barents Sea Arctic  159  43     7 0.5911950   848  5.333333 0.033542977
#> 4  Barents Sea Boreal  180  22     6 0.6722222  1546  8.588889 0.047716049
#> 5          Beach Peru   46  20     5 0.3043478    88  1.913043 0.041587902
#> 6      Beagle Channel  145  11    36 0.5517241  1115  7.689655 0.053032105
#> 7            Benguela   29   0     2 0.8620690   212  7.310345 0.252080856
#> 8      Caribbean Reef  250   5     1 0.9760000  3382 13.528000 0.054112000
#> 9           Cayman Is  242  10    11 0.7727273  3766 15.561983 0.064305717
#> 10         Celtic Sea   48  19    17 0.4583333   169  3.520833 0.073350694
#> 11      Chilean rocky  106   8    48 0.3679245  1362 12.849057 0.121217515
#> 12               Cuba  240  10    11 0.8291667  3874 16.141667 0.067256944
#> 13            Florida   48   9     6 0.7083333   221  4.604167 0.095920139
#> 14        Gulf Alaska  405  14   373 0.0345679  1057  2.609877 0.006444140
#> 15         Gulf Cadiz   42   6     2 0.8333333   410  9.761905 0.232426304
#> 16         Gulf Lions   39   9     6 0.8461538   189  4.846154 0.124260355
#> 17      Gulf Tortugas  256  23   204 0.0546875   647  2.527344 0.009872437
#> 18            Jamaica  249  11     9 0.8273092  4105 16.485944 0.066208610
#> 19  Kerguelen Plateau   28   4     4 0.8214286   173  6.178571 0.220663265
#> 20         La Guajira   27   3     4 0.8518519   198  7.333333 0.271604938
#> 21       Monterey Bay   37  12     5 0.3513514    79  2.135135 0.057706355
#> 22        NE US Shelf   81   4     2 0.9506173  1490 18.395062 0.227099528
#> 23        Potter Cove  110   6    30 0.4636364   649  5.900000 0.053636364
#> 24   Sanak intertidal  235  19    41 0.6042553  1804  7.676596 0.032666365
#> 25    Sanak nearshore  513  41    56 0.7270955  6774 13.204678 0.025740114
#> 26          Simon Bay   26   5    10 0.1923077    70  2.692308 0.103550296
#> 27    Southern Brazil  143   9    66 0.4895105   840  5.874126 0.041077803
#> 28   SW Pacific Ocean  108  78    27 0.1574074   202  1.870370 0.017318244
#> 29        Weddell Sea  435 252    14 0.4689655  1978  4.547126 0.010453164
#>    PathLength Clustering Cannib   TLmean    TLmax   LOmnivory Components
#> 1    1.608333 0.35763293      3 2.897171 4.039211 0.210661151          1
#> 2    1.413115 0.30550459      7 2.393618 3.678314 0.127265400          1
#> 3    2.056762 0.16540420     10 2.843582 5.190582 0.159415794          1
#> 4    2.280036 0.24859772     23 3.002873 4.796090 0.227145018          1
#> 5    1.733032 0.09312639      0 2.633627 4.162698 0.073120694          1
#> 6    2.121089 0.22267298      0 2.376811 4.120973 0.220455060          1
#> 7    1.503012 0.57603518      7 3.426052 4.666712 0.300625568          1
#> 8    1.893206 0.15505307     10 3.944124 5.874534 0.469036276          1
#> 9    1.854293 0.11295708      2 3.195069 4.954891 0.419532533          1
#> 10   1.419118 0.28825623      6 1.814819 2.944444 0.123462555          1
#> 11   1.339971 0.11196400      2 1.714422 3.233646 0.043858545          1
#> 12   1.860959 0.11358725      2 3.312343 5.010049 0.416505669          1
#> 13   1.765112 0.31518010      3 2.738179 4.650676 0.261322309          1
#> 14   2.310446 0.04313612      4 1.087722 3.025025 0.003162364          1
#> 15   1.992410 0.55996358     14 3.320370 4.672548 0.369765638          1
#> 16   1.771552 0.34351145      9 2.785397 4.316024 0.242857024          1
#> 17   1.650193 0.02872340      0 1.218783 2.828880 0.009791776          1
#> 18   1.840726 0.11603916      2 3.279659 4.959277 0.390369432          1
#> 19   1.561905 0.58473421      5 3.115334 4.796731 0.340087506          1
#> 20   1.532578 0.66183206     10 2.820707 4.237618 0.471580050          1
#> 21   1.396694 0.08674699      0 2.248430 3.388889 0.069381710          1
#> 22   2.006478 0.57322245     25 4.740175 6.500256 0.695680643          1
#> 23   2.336854 0.18495684      0 2.221820 4.419660 0.226861551          1
#> 24   3.064434 0.15531988     47 2.555023 4.304591 0.211130071          1
#> 25   3.412703 0.17897753     94 3.096074 5.270032 0.296344995          1
#> 26   1.707006 0.14457831      0 1.975078 4.214286 0.038418487          1
#> 27   3.370396 0.17738952     12 1.917638 3.661938 0.229439952          1
#> 28   1.198413 0.01675042      0 1.892855 3.000000 0.030252434          1
#> 29   2.173006 0.05561247      7 2.790835 5.146343 0.191524063          1
#>    Vulnerability     VulSD Generality     GenSD
#> 1       5.291667 0.9515706   4.884615 0.5954786
#> 2       6.586207 0.7377881   6.586207 0.9311804
#> 3       7.310345 1.6540281   5.578947 1.0462268
#> 4       9.784810 1.2292073   8.885057 1.3645655
#> 5       3.384615 1.3800444   2.146341 0.8452183
#> 6       8.320896 1.2057445  10.229358 1.2296630
#> 7       7.310345 0.7652203   7.851852 0.9059806
#> 8      13.804082 1.9035733  13.582329 1.2104641
#> 9      16.232759 1.0535105  16.303030 1.2135240
#> 10      5.827586 1.3411641   5.451613 1.3257180
#> 11     13.897959 0.7838649  23.482759 1.3479895
#> 12     16.843478 1.0330555  16.917031 1.1701145
#> 13      5.666667 0.9491005   5.261905 0.7453336
#> 14      2.703325 1.2310513  33.031250 6.0630973
#> 15     11.388889 0.8138112  10.250000 0.7203884
#> 16      6.300000 0.9650096   5.727273 0.5998126
#> 17      2.776824 1.1689865  12.442308 2.6285446
#> 18     17.247899 1.0461240  17.104167 1.1989725
#> 19      7.208333 0.8530838   7.208333 0.6666741
#> 20      8.250000 0.7815213   8.608696 0.6807684
#> 21      3.160000 1.2738808   2.468750 1.1846588
#> 22     19.350649 0.9186556  18.860759 0.7305467
#> 23      6.240385 1.1878726   8.112500 1.5936057
#> 24      8.351852 1.2690317   9.298969 1.2754158
#> 25     14.351695 1.4059570  14.822757 1.2438225
#> 26      3.333333 0.7984884   4.375000 1.0387748
#> 27      6.268657 1.0900308  10.909091 1.2942680
#> 28      6.733333 2.4211246   2.493827 1.5644876
#> 29     10.808743 3.1827981   4.698337 1.0908340

# Generate a test network

g <-   graph_from_literal( 1 -+ 4 -+ 7,2 -+ 5 -+7, 3-+6-+7, 7-+7, 4+-3, simplify = FALSE)

calc_topological_indices(g)
#>   Size Top Basal  Omnivory Links       LD Connectance PathLength Clustering
#> 1    7   1     3 0.1428571     8 1.142857   0.1632653        1.3          0
#>   Cannib   TLmean TLmax LOmnivory Components Vulnerability     VulSD Generality
#> 1      1 1.642857   2.5    0.0625          1      1.333333 0.3307189          2
#>      GenSD
#> 1 1.280869