Skip to contents

This function calculates metrics to assess the contribution of a given species or site to its bioregion.

Usage

site_species_metrics(
  bioregionalization,
  comat,
  indices = c("rho"),
  net = NULL,
  site_col = 1,
  species_col = 2
)

Arguments

bioregionalization

A bioregion.clusters object.

comat

A co-occurrence matrix with sites as rows and species as columns.

indices

A character specifying the contribution metric to compute. Available options are rho, affinity, fidelity, indicator_value and Cz.

net

NULL by default. Required for Cz indices. A data.frame where each row represents an interaction between two nodes and an optional third column indicating the interaction's weight.

site_col

A number indicating the position of the column containing the sites in net. 1 by default.

species_col

A number indicating the position of the column containing the species in net. 2 by default.

Value

A data.frame with columns Bioregion, Species, and the desired summary statistics, or a list of data.frames if Cz and other indices are selected.

Details

The \(\rho\) metric is derived from Lenormand et al. (2019) with the following formula:

\(\rho_{ij} = \frac{n_{ij} - \frac{n_i n_j}{n}}{\sqrt{\left(\frac{n - n_j}{ n-1}\right) \left(1-\frac{n_j}{n}\right) \frac{n_i n_j}{n}}}\)

where \(n\) is the number of sites, \(n_i\) is the number of sites in which species \(i\) is present, \(n_j\) is the number of sites in bioregion \(j\), and \(n_{ij}\) is the number of occurrences of species \(i\) in sites of bioregion \(j\).

Affinity \(A\), fidelity \(F\), and individual contributions \(IndVal\) describe how species are linked to their bioregions. These metrics are described in Bernardo-Madrid et al. (2019):

  • Affinity of species to their region: \(A_i = \frac{R_i}{Z}\), where \(R_i\) is the occurrence/range size of species \(i\) in its associated bioregion, and \(Z\) is the total size (number of sites) of the bioregion. High affinity indicates that the species occupies most sites in its bioregion.

  • Fidelity of species to their region: \(F_i = \frac{R_i}{D_i}\), where \(R_i\) is the occurrence/range size of species \(i\) in its bioregion, and \(D_i\) is its total range size. High fidelity indicates that the species is not present in other regions.

  • Indicator Value of species: \(IndVal = F_i \cdot A_i\).

Cz metrics are derived from Guimerà & Amaral (2005):

  • Participation coefficient: \(C_i = 1 - \sum_{s=1}^{N_M}{\left(\frac{k_{is}}{k_i}\right)^2}\), where \(k_{is}\) is the number of links of node \(i\) to nodes in bioregion \(s\), and \(k_i\) is the total degree of node \(i\). A high value means links are uniformly distributed; a low value means links are within the node's bioregion.

  • Within-bioregion degree z-score: \(z_i = \frac{k_i - \overline{k_{si}}}{\sigma_{k_{si}}}\), where \(k_i\) is the number of links of node \(i\) to nodes in its bioregion \(s_i\), \(\overline{k_{si}}\) is the average degree of nodes in \(s_i\), and \(\sigma_{k_{si}}\) is the standard deviation of degrees in \(s_i\).

References

Bernardo-Madrid R, Calatayud J, González‐Suárez M, Rosvall M, Lucas P, Antonelli A & Revilla E (2019) Human activity is altering the world’s zoogeographical regions. Ecology Letters 22, 1297–1305.

Guimerà R & Amaral LAN (2005) Functional cartography of complex metabolic networks. Nature 433, 895–900.

Lenormand M, Papuga G, Argagnon O, Soubeyrand M, Alleaume S & Luque S (2019) Biogeographical network analysis of plant species distribution in the Mediterranean region. Ecology and Evolution 9, 237–250.

See also

For more details illustrated with a practical example, see the vignette: https://biorgeo.github.io/bioregion/articles/a5_3_summary_metrics.html.

Associated functions: bioregion_metrics bioregionalization_metrics

Author

Pierre Denelle (pierre.denelle@gmail.com)
Boris Leroy (leroy.boris@gmail.com)
Maxime Lenormand (maxime.lenormand@inrae.fr)

Examples

comat <- matrix(sample(0:1000, size = 500, replace = TRUE, prob = 1/1:1001),
                20, 25)
rownames(comat) <- paste0("Site",1:20)
colnames(comat) <- paste0("Species",1:25)

dissim <- dissimilarity(comat, metric = "Simpson")
clust1 <- nhclu_kmeans(dissim, n_clust = 3, index = "Simpson")

net <- similarity(comat, metric = "Simpson")
com <- netclu_greedy(net)

site_species_metrics(bioregionalization = clust1, comat = comat,
indices = "rho")
#>    Bioregion   Species          rho
#> 1          2  Species1  691.3133454
#> 2          2  Species2 1096.2512131
#> 3          2  Species3  412.6304623
#> 4          2  Species4  710.4705820
#> 5          2  Species5 1963.8050546
#> 6          2  Species6 1101.5075599
#> 7          2  Species7  367.9637192
#> 8          2  Species8  723.8416417
#> 9          2  Species9 1069.7368973
#> 10         2 Species10  662.1893978
#> 11         2 Species11  316.5853082
#> 12         2 Species12  942.3847907
#> 13         2 Species13  742.1085669
#> 14         2 Species14  675.9023104
#> 15         2 Species15  527.5710984
#> 16         2 Species16  227.0991279
#> 17         2 Species17 1202.4261351
#> 18         2 Species18  925.0473763
#> 19         2 Species19  307.7180046
#> 20         2 Species20  177.3817961
#> 21         2 Species21  436.1779924
#> 22         2 Species22  608.1278588
#> 23         2 Species23 1947.3126985
#> 24         2 Species24  512.1929169
#> 25         2 Species25  560.4276251
#> 26         1  Species1  183.3278484
#> 27         1  Species2 1051.4573220
#> 28         1  Species3 1009.6815711
#> 29         1  Species4  536.3843150
#> 30         1  Species5 1194.3072004
#> 31         1  Species6  488.4302527
#> 32         1  Species7 1242.3913858
#> 33         1  Species8 1506.1928495
#> 34         1  Species9  676.9823831
#> 35         1 Species10 1606.9214943
#> 36         1 Species11  440.2892832
#> 37         1 Species12  269.4781531
#> 38         1 Species13  437.9754559
#> 39         1 Species14  913.8824323
#> 40         1 Species15  642.3366718
#> 41         1 Species16  595.4568834
#> 42         1 Species17  353.3680884
#> 43         1 Species18 1938.7264570
#> 44         1 Species19 1343.5323467
#> 45         1 Species20   87.6778193
#> 46         1 Species21   96.5192801
#> 47         1 Species22 1145.6882108
#> 48         1 Species23 1142.0084391
#> 49         1 Species24  517.8497341
#> 50         1 Species25  293.9785706
#> 51         3  Species1    0.3424674
#> 52         3  Species2   11.8636804
#> 53         3  Species3  190.4118992
#> 54         3  Species4  201.4804211
#> 55         3  Species5  341.6085246
#> 56         3  Species6  112.3809319
#> 57         3  Species7    9.0406793
#> 58         3  Species8  639.6173673
#> 59         3  Species9  212.0535988
#> 60         3 Species10  575.6975420
#> 61         3 Species11   64.2058096
#> 62         3 Species12   30.3083688
#> 63         3 Species13  579.1204538
#> 64         3 Species14   14.0411652
#> 65         3 Species15   -1.3698698
#> 66         3 Species16  166.6414981
#> 67         3 Species17  864.9095668
#> 68         3 Species18  278.5972662
#> 69         3 Species19   94.1723204
#> 70         3 Species20  257.7436212
#> 71         3 Species21   90.2468787
#> 72         3 Species22   78.3261041
#> 73         3 Species23  115.0690614
#> 74         3 Species24  251.0920600
#> 75         3 Species25   -1.2813958

# Contribution metrics
site_species_metrics(bioregionalization = com, comat = comat,
indices = c("rho", "affinity", "fidelity", "indicator_value"))
#>    Bioregion   Species           rho  affinity     fidelity       indval
#> 1          1  Species1  6.704000e+03  71.36842  84.75000000 6.048474e+03
#> 2          1  Species2  1.571016e+04 181.15789 181.15789474 3.281818e+04
#> 3          1  Species3  8.989000e+03  95.42105 113.31250000 1.081240e+04
#> 4          1  Species4  1.006091e+04  92.31579 146.16666667 1.349349e+04
#> 5          1  Species5  2.572407e+04 288.10526 304.11111111 8.761601e+04
#> 6          1  Species6  1.278090e+04 139.52632 155.94117647 2.175790e+04
#> 7          1  Species7  1.178936e+04 132.52632 139.88888889 1.853896e+04
#> 8          1  Species8  2.028930e+04 233.68421 233.68421053 5.460831e+04
#> 9          1  Species9  1.231523e+04 134.47368 150.29411765 2.021060e+04
#> 10         1 Species10  1.613099e+04 181.00000 191.05555556 3.458106e+04
#> 11         1 Species11  5.466025e+03  60.15789  67.23529412 4.044734e+03
#> 12         1 Species12  9.469000e+03 100.47368 119.31250000 1.198777e+04
#> 13         1 Species13  1.217257e+04 140.57895 140.57894737 1.976244e+04
#> 14         1 Species14  8.834000e+03  93.78947 111.37500000 1.044580e+04
#> 15         1 Species15  7.939000e+03  84.36842 100.18750000 8.452661e+03
#> 16         1 Species16  7.061187e+03  81.94737  81.94736842 6.715371e+03
#> 17         1 Species17  1.698162e+04 185.10526 206.88235294 3.829501e+04
#> 18         1 Species18  2.289900e+04 241.84211 287.18750000 6.945403e+04
#> 19         1 Species19  1.269693e+04 130.15789 164.86666667 2.145870e+04
#> 20         1 Species20  3.103972e+03  31.26316  42.42857143 1.326451e+03
#> 21         1 Species21  4.627361e+03  46.26316  62.78571429 2.904665e+03
#> 22         1 Species22  1.313500e+04 143.36842 160.23529412 2.297268e+04
#> 23         1 Species23  2.412400e+04 254.73684 302.50000000 7.705789e+04
#> 24         1 Species24  9.011896e+03  98.63158 110.23529412 1.087268e+04
#> 25         1 Species25  6.460773e+03  64.31579  87.28571429 5.613850e+03
#> 26         2  Species1  2.523573e+00   3.00000   0.18750000 5.625000e-01
#> 27         2  Species2  1.200526e+02 115.00000   6.05263158 6.960526e+02
#> 28         2  Species3  6.104753e+02 533.00000  33.31250000 1.775556e+04
#> 29         2  Species4  1.237113e+02  94.00000   7.83333333 7.363333e+02
#> 30         2  Species5  5.201900e+01  49.00000   2.72222222 1.333889e+02
#> 31         2  Species6 -9.459053e-01   0.00000   0.00000000 0.000000e+00
#> 32         2  Species7  3.255243e+01  31.00000   1.72222222 5.338889e+01
#> 33         2  Species8  2.157895e+00   3.00000   0.15789474 4.736842e-01
#> 34         2  Species9  4.964890e+02 447.00000  26.29411765 1.175347e+04
#> 35         2 Species10  9.280147e+02 859.00000  47.72222222 4.099339e+04
#> 36         2 Species11  1.303680e+02 118.00000   6.94117647 8.190588e+02
#> 37         2 Species12  2.294157e-01   1.00000   0.06250000 6.250000e-02
#> 38         2 Species13  3.794737e+01  37.00000   1.94736842 7.205263e+01
#> 39         2 Species14  7.205948e+02 629.00000  39.31250000 2.472756e+04
#> 40         2 Species15  1.883503e+02 165.00000  10.31250000 1.701562e+03
#> 41         2 Species16  5.263158e-02   1.00000   0.05263158 5.263158e-02
#> 42         2 Species17 -9.459053e-01   0.00000   0.00000000 0.000000e+00
#> 43         2 Species18 -9.176629e-01   0.00000   0.00000000 0.000000e+00
#> 44         2 Species19 -8.885233e-01   0.00000   0.00000000 0.000000e+00
#> 45         2 Species20  9.601762e+01  79.00000   5.64285714 4.457857e+02
#> 46         2 Species21 -8.583951e-01   0.00000   0.00000000 0.000000e+00
#> 47         2 Species22  8.474199e+01  77.00000   4.52941176 3.487647e+02
#> 48         2 Species23 -9.176629e-01   0.00000   0.00000000 0.000000e+00
#> 49         2 Species24  4.579294e+01  42.00000   2.47058824 1.037647e+02
#> 50         2 Species25  6.499277e+00   6.00000   0.42857143 2.571429e+00

# Cz indices
net_bip <- mat_to_net(comat, weight = TRUE)
clust_bip <- netclu_greedy(net_bip, bipartite = TRUE)
site_species_metrics(bioregionalization = clust_bip, comat = comat, 
net = net_bip, indices = "Cz")
#>         Node Bioregion Category         C          z
#> 1      Site1         7     site 0.8368056 -0.5773503
#> 2      Site2         5     site 0.8088643  1.0690450
#> 3      Site3         3     site 0.8299320  1.0223973
#> 4      Site4         2     site 0.8144044  0.4677072
#> 5      Site5         1     site 0.8299320        NaN
#> 6      Site6         1     site 0.8199446        NaN
#> 7      Site7         7     site 0.8209877 -0.5773503
#> 8      Site8         5     site 0.8365651  1.0690450
#> 9      Site9         4     site 0.8350000 -0.3333333
#> 10    Site10         4     site 0.8347107 -0.3333333
#> 11    Site11         2     site 0.8209877  1.4031215
#> 12    Site12         4     site 0.8250000 -0.3333333
#> 13    Site13         4     site 0.8166090 -1.8333333
#> 14    Site14         3     site 0.8279773  1.7380754
#> 15    Site15         6     site 0.8347107  1.0690450
#> 16    Site16         6     site 0.8355388  1.0690450
#> 17    Site17         5     site 0.8388430  1.0690450
#> 18    Site18         4     site 0.8253968 -0.3333333
#> 19    Site19         6     site 0.8355388  1.0690450
#> 20    Site20         2     site 0.8347107  1.4031215
#> 21  Species1         6  species 0.8437500 -0.8017837
#> 22  Species2         5  species 0.8310249 -0.8017837
#> 23  Species3         5  species 0.8046875 -0.8017837
#> 24  Species4         2  species 0.8055556 -0.4677072
#> 25  Species5         2  species 0.8395062 -0.4677072
#> 26  Species6         6  species 0.8373702 -0.8017837
#> 27  Species7         4  species 0.8271605  1.1666667
#> 28  Species8         4  species 0.8365651  1.1666667
#> 29  Species9         3  species 0.8166090 -1.1246370
#> 30 Species10         5  species 0.8209877 -0.8017837
#> 31 Species11         2  species 0.8512111 -0.4677072
#> 32 Species12         5  species 0.8281250 -0.8017837
#> 33 Species13         2  species 0.8365651 -0.4677072
#> 34 Species15         1  species 0.8281250        NaN
#> 35 Species16         3  species 0.8365651 -0.4089589
#> 36 Species17         7  species 0.8235294  1.1547005
#> 37 Species18         4  species 0.8203125  1.1666667
#> 38 Species19         4  species 0.8355556 -0.3333333
#> 39 Species20         2  species 0.8469388 -1.4031215
#> 40 Species21         3  species 0.8571429 -0.4089589
#> 41 Species22         3  species 0.8442907 -0.4089589
#> 42 Species23         6  species 0.8203125 -0.8017837
#> 43 Species24         1  species 0.8442907        NaN
#> 44 Species25         6  species 0.8265306 -0.8017837
#> 45 Species14         3  species 0.8046875 -0.4089589