Calculate contribution metrics of sites and species
Source:R/site_species_metrics.R
site_species_metrics.Rd
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 arerho
,affinity
,fidelity
,indicator_value
andCz
.- net
NULL
by default. Required forCz
indices. Adata.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.frame
s 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 1 Species1 945.036475
#> 2 1 Species2 719.454482
#> 3 1 Species3 824.641591
#> 4 1 Species4 422.970387
#> 5 1 Species5 370.027219
#> 6 1 Species6 360.063719
#> 7 1 Species7 183.228045
#> 8 1 Species8 903.247868
#> 9 1 Species9 100.371314
#> 10 1 Species10 1231.204734
#> 11 1 Species11 549.190736
#> 12 1 Species12 344.283940
#> 13 1 Species13 193.837626
#> 14 1 Species14 724.806678
#> 15 1 Species15 209.256688
#> 16 1 Species16 697.276477
#> 17 1 Species17 526.743290
#> 18 1 Species18 1562.079647
#> 19 1 Species19 559.003852
#> 20 1 Species20 666.227270
#> 21 1 Species21 668.331313
#> 22 1 Species22 162.915839
#> 23 1 Species23 317.235474
#> 24 1 Species24 175.225890
#> 25 1 Species25 330.192828
#> 26 3 Species1 610.405412
#> 27 3 Species2 191.096834
#> 28 3 Species3 40.197116
#> 29 3 Species4 854.194755
#> 30 3 Species5 175.244631
#> 31 3 Species6 142.753940
#> 32 3 Species7 945.517829
#> 33 3 Species8 564.153360
#> 34 3 Species9 616.826676
#> 35 3 Species10 851.120862
#> 36 3 Species11 1193.468888
#> 37 3 Species12 220.650366
#> 38 3 Species13 357.913882
#> 39 3 Species14 662.947826
#> 40 3 Species15 170.438636
#> 41 3 Species16 392.724542
#> 42 3 Species17 443.639048
#> 43 3 Species18 693.472580
#> 44 3 Species19 56.181364
#> 45 3 Species20 1182.540086
#> 46 3 Species21 1119.268384
#> 47 3 Species22 754.210598
#> 48 3 Species23 238.716037
#> 49 3 Species24 1031.916412
#> 50 3 Species25 108.851393
#> 51 2 Species1 424.310447
#> 52 2 Species2 215.729048
#> 53 2 Species3 46.784613
#> 54 2 Species4 380.595122
#> 55 2 Species5 129.542871
#> 56 2 Species6 108.128205
#> 57 2 Species7 147.336166
#> 58 2 Species8 534.420247
#> 59 2 Species9 1076.695882
#> 60 2 Species10 249.992400
#> 61 2 Species11 222.013253
#> 62 2 Species12 0.472789
#> 63 2 Species13 151.009124
#> 64 2 Species14 134.744857
#> 65 2 Species15 345.111321
#> 66 2 Species16 26.641238
#> 67 2 Species17 712.175852
#> 68 2 Species18 576.014564
#> 69 2 Species19 979.280086
#> 70 2 Species20 116.311746
#> 71 2 Species21 620.894818
#> 72 2 Species22 600.678213
#> 73 2 Species23 83.683648
#> 74 2 Species24 113.583065
#> 75 2 Species25 402.187911
# Contribution metrics
site_species_metrics(bioregionalization = com, comat = comat,
indices = c("rho", "affinity", "fidelity", "indicator_value"))
#> Bioregion Species rho affinity fidelity indval
#> 1 2 Species1 8.2589664 8.00000 0.5000000 4.00000
#> 2 2 Species2 42.6713265 38.00000 2.3750000 90.25000
#> 3 2 Species3 712.5652694 622.00000 38.8750000 24180.25000
#> 4 2 Species4 68.0495403 62.00000 3.6470588 226.11765
#> 5 2 Species5 157.9473684 151.00000 7.9473684 1200.05263
#> 6 2 Species6 404.5802243 375.00000 20.8333333 7812.50000
#> 7 2 Species7 15.2488136 15.00000 0.8333333 12.50000
#> 8 2 Species8 255.8421053 244.00000 12.8421053 3133.47368
#> 9 2 Species9 -0.9176629 0.00000 0.0000000 0.00000
#> 10 2 Species10 753.7368421 717.00000 37.7368421 27057.31579
#> 11 2 Species11 198.0138220 194.00000 9.7000000 1881.80000
#> 12 2 Species12 201.5891125 182.00000 10.7058824 1948.47059
#> 13 2 Species13 21.1052632 21.00000 1.1052632 23.21053
#> 14 2 Species14 -0.9459053 0.00000 0.0000000 0.00000
#> 15 2 Species15 54.7922712 47.00000 3.1333333 147.26667
#> 16 2 Species16 9.4060451 9.00000 0.5625000 5.06250
#> 17 2 Species17 -0.9733285 0.00000 0.0000000 0.00000
#> 18 2 Species18 773.5836133 696.00000 40.9411765 28495.05882
#> 19 2 Species19 267.2327544 248.00000 13.7777778 3416.88889
#> 20 2 Species20 305.3523418 267.00000 16.6875000 4455.56250
#> 21 2 Species21 16.3302897 16.00000 0.8888889 14.22222
#> 22 2 Species22 -0.9733285 0.00000 0.0000000 0.00000
#> 23 2 Species23 272.8102177 246.00000 14.4705882 3559.76471
#> 24 2 Species24 262.1143784 222.00000 14.8000000 3285.60000
#> 25 2 Species25 -0.9733285 0.00000 0.0000000 0.00000
#> 26 1 Species1 15439.0000000 163.31579 193.9375000 31673.05592
#> 27 1 Species2 8639.0000000 91.73684 108.9375000 9993.58224
#> 28 1 Species3 4074.0000000 43.68421 51.8750000 2266.11842
#> 29 1 Species4 12620.8263200 137.78947 154.0000000 21219.57895
#> 30 1 Species5 4592.6735764 53.63158 53.6315789 2876.34626
#> 31 1 Species6 3021.2315737 34.63158 36.5555556 1265.97661
#> 32 1 Species7 9875.4533061 111.15789 117.3333333 13042.52632
#> 33 1 Species8 14517.1982236 167.47368 167.4736842 28047.43490
#> 34 1 Species9 13884.0000000 146.94737 174.5000000 25642.31579
#> 35 1 Species10 14980.6180060 172.78947 172.7894737 29856.20222
#> 36 1 Species11 14471.8319504 171.31579 162.7500000 27881.64474
#> 37 1 Species12 3559.6953687 39.47368 44.1176471 1741.48607
#> 38 1 Species13 5386.4520155 62.73684 62.7368421 3935.91136
#> 39 1 Species14 11922.3237199 130.21053 145.5294118 18949.46130
#> 40 1 Species15 5395.0658013 55.73684 70.6000000 3935.02105
#> 41 1 Species16 8724.0000000 92.63158 110.0000000 10189.47368
#> 42 1 Species17 13095.1461831 147.10526 155.2777778 22842.17836
#> 43 1 Species18 18786.0819084 204.68421 228.7647059 46824.52322
#> 44 1 Species19 11218.9561903 126.15789 133.1666667 16800.02632
#> 45 1 Species20 14029.0000000 148.47368 176.3125000 26177.76645
#> 46 1 Species21 18695.4318901 209.63158 221.2777778 46386.80994
#> 47 1 Species22 11784.6416153 132.47368 139.8333333 18524.23684
#> 48 1 Species23 3816.7831312 42.26316 47.2352941 1996.31269
#> 49 1 Species24 9149.2776582 94.00000 119.0666667 11192.26667
#> 50 1 Species25 6552.0514345 74.05263 78.1666667 5788.44737
# 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 4 site 0.8050000 1.0690450
#> 2 Site2 1 site 0.8052930 0.6681531
#> 3 Site3 3 site 0.8050000 1.0954451
#> 4 Site4 4 site 0.7901701 1.0690450
#> 5 Site5 4 site 0.8052930 1.0690450
#> 6 Site6 5 site 0.8016529 0.6454972
#> 7 Site7 5 site 0.8117914 0.6454972
#> 8 Site8 6 site 0.7986111 NaN
#> 9 Site9 1 site 0.7951389 1.6035675
#> 10 Site10 6 site 0.7850000 NaN
#> 11 Site11 3 site 0.8254848 1.0954451
#> 12 Site12 6 site 0.8000000 NaN
#> 13 Site13 1 site 0.7845805 0.6681531
#> 14 Site14 5 site 0.7709751 -1.2909944
#> 15 Site15 1 site 0.7727273 1.6035675
#> 16 Site16 2 site 0.8125000 1.2421180
#> 17 Site17 2 site 0.7986111 -0.2070197
#> 18 Site18 2 site 0.8052930 1.2421180
#> 19 Site19 1 site 0.7654321 0.6681531
#> 20 Site20 1 site 0.7981859 0.6681531
#> 21 Species1 5 species 0.8125000 0.6454972
#> 22 Species2 1 species 0.7578125 -0.2672612
#> 23 Species3 3 species 0.8046875 -0.7302967
#> 24 Species4 1 species 0.7889273 -0.2672612
#> 25 Species5 3 species 0.8033241 -0.7302967
#> 26 Species6 4 species 0.7901235 -0.8017837
#> 27 Species7 2 species 0.8271605 -0.2070197
#> 28 Species8 6 species 0.8199446 NaN
#> 29 Species10 4 species 0.7977839 -0.8017837
#> 30 Species11 2 species 0.8100000 -0.2070197
#> 31 Species12 4 species 0.8096886 -0.8017837
#> 32 Species13 1 species 0.8199446 -1.2026756
#> 33 Species15 5 species 0.8266667 -1.2909944
#> 34 Species16 6 species 0.8281250 NaN
#> 35 Species18 6 species 0.7820069 NaN
#> 36 Species19 1 species 0.7962963 -0.2672612
#> 37 Species20 4 species 0.7812500 -0.8017837
#> 38 Species21 1 species 0.8086420 -1.2026756
#> 39 Species23 1 species 0.8027682 -1.2026756
#> 40 Species24 2 species 0.7911111 -1.6561573
#> 41 Species14 5 species 0.8096886 0.6454972
#> 42 Species17 3 species 0.8148148 -0.7302967
#> 43 Species22 2 species 0.7962963 -0.2070197
#> 44 Species25 1 species 0.7901235 -0.2672612
#> 45 Species9 1 species 0.7968750 -1.2026756