Compute the co-occurrence between all pairs of species and descriptive metrics of the co-occurrence network.
Arguments
- x
a
pa
object or an R object to a coerced to one (seeec_as_pa()
).
Details
Currently bi
tests the presence of a significant value of occurrence
assuming species occurrence are independent binomial distribution. by
takes the limited number of sites into account by using an hypergeometric
distribution (see Veech 2013). Note that if the number of sites is large and
the occurrence of both species relatively low, then bi
and hy
give very similar results.
Functions
ec_cooc_count_pair()
: A matrix with all pairs of species and the corresponding co-occurrence counts.ec_cooc_count_triplet()
: A matrix with all triplets of species and the corresponding co-occurrence counts.ec_checkerboard()
: Compute the checkerboard score and return a list of three elements:units
which incudes checkerboard units and tc_score
checkerboard scores.c_score_s2
the S2 statistics in Roberts & Stone (1990).
References
Veech, J. A. (2013). A probabilistic model for analysing species co-occurrence: Probabilistic model. Global Ecology and Biogeography, 22(2), 252–260.
Arita, H. T. (2016). Species co-occurrence analysis: Pairwise versus matrix-level approaches: Correspondence. Global Ecology and Biogeography, 25(11), 1397–1400.
Stone, L., & Roberts, A. (1990). The checkerboard score and species distributions. Oecologia, 85(1), 74–79. https://doi.org/10.1007/BF00317345
Roberts, A., & Stone, L. (1990). Island-sharing by archipelago species. Oecologia, 83(4), 560–567. https://doi.org/10.1007/BF00317210
Examples
mat <- ec_generate_pa(1000, 6, .2)
#> ! Empty site(s): 6, 11, 16, 20, 24, 25, 26, 33, 34, 35, 36, 38, 39, 44, 54, 81, 83, 85, 87, 89, 97, 100, 103, 104, 107, 117, 119, 121, 122, 133, 140, 141, 150, 152, 153, 156, 160, 161, 163, 164, 165, 167, 169, 174, 177, 179, 180, 193, 203, 205, 206, 208, 222, 228, 230, 235, 237, 240, 247, 249, 252, 254, 266, 267, 272, 286, 287, 288, 291, 297, 298, 300, 302, 303, 308, 318, 322, 324, 331, 333, 340, 342, 343, 349, 350, 352, 358, 360, 368, 369, 374, 384, 385, 386, 389, 390, 392, 393, 398, 404, 406, 410, 416, 418, 419, 426, 427, 432, 434, 435, 438, 439, 440, 445, 446, 447, 452, 454, 462, 464, 470, 473, 474, 475, 476, 488, 490, 494, 497, 498, 510, 512, 513, 516, 525, 527, 531, 535, 536, 538, 539, 541, 552, 553, 556, 559, 560, 562, 568, 569, 574, 576, 577, 580, 581, 589, 598, 602, 605, 616, 617, 621, 631, 632, 633, 638, 644, 646, 648, 653, 654, 656, 657, 661, 662, 663, 666, 677, 680, 681, 682, 685, 686, 691, 692, 693, 694, 702, 705, 706, 716, 721, 733, 737, 739, 743, 749, 752, 756, 757, 760, 762, 765, 771, 779, 798, 802, 803, 810, 811, 815, 816, 818, 819, 822, 823, 825, 828, 830, 832, 833, 838, 839, 844, 850, 858, 860, 863, 864, 874, 877, 884, 888, 892, 900, 902, 903, 910, 913, 920, 921, 924, 929, 934, 937, 944, 947, 952, 957, 965, 970, 971, 975, 977, 979, 980, 984, 988, 989, 992, 993, 995, 996, 998, 999
out <- ec_cooc_count_pair(mat)
#plot(out$zs_bi*sqrt(1/0.2), out$zs_hy)
#abline(0,1)
# Classical example, in Stone & Roberts 1990
mat0 <- matrix(0, 10, 10)
mat1 <- matrix(1, 10, 10)
matU <- rbind(cbind(mat1, mat0), cbind(mat0, mat1))
ec_checkerboard(matU)
#> $c_units
#> species1 species2 c_units
#> 1 1 2 0
#> 2 1 3 0
#> 3 1 4 0
#> 4 1 5 0
#> 5 1 6 0
#> 6 1 7 0
#> 7 1 8 0
#> 8 1 9 0
#> 9 1 10 0
#> 10 1 11 100
#> 11 1 12 100
#> 12 1 13 100
#> 13 1 14 100
#> 14 1 15 100
#> 15 1 16 100
#> 16 1 17 100
#> 17 1 18 100
#> 18 1 19 100
#> 19 1 20 100
#> 20 2 3 0
#> 21 2 4 0
#> 22 2 5 0
#> 23 2 6 0
#> 24 2 7 0
#> 25 2 8 0
#> 26 2 9 0
#> 27 2 10 0
#> 28 2 11 100
#> 29 2 12 100
#> 30 2 13 100
#> 31 2 14 100
#> 32 2 15 100
#> 33 2 16 100
#> 34 2 17 100
#> 35 2 18 100
#> 36 2 19 100
#> 37 2 20 100
#> 38 3 4 0
#> 39 3 5 0
#> 40 3 6 0
#> 41 3 7 0
#> 42 3 8 0
#> 43 3 9 0
#> 44 3 10 0
#> 45 3 11 100
#> 46 3 12 100
#> 47 3 13 100
#> 48 3 14 100
#> 49 3 15 100
#> 50 3 16 100
#> 51 3 17 100
#> 52 3 18 100
#> 53 3 19 100
#> 54 3 20 100
#> 55 4 5 0
#> 56 4 6 0
#> 57 4 7 0
#> 58 4 8 0
#> 59 4 9 0
#> 60 4 10 0
#> 61 4 11 100
#> 62 4 12 100
#> 63 4 13 100
#> 64 4 14 100
#> 65 4 15 100
#> 66 4 16 100
#> 67 4 17 100
#> 68 4 18 100
#> 69 4 19 100
#> 70 4 20 100
#> 71 5 6 0
#> 72 5 7 0
#> 73 5 8 0
#> 74 5 9 0
#> 75 5 10 0
#> 76 5 11 100
#> 77 5 12 100
#> 78 5 13 100
#> 79 5 14 100
#> 80 5 15 100
#> 81 5 16 100
#> 82 5 17 100
#> 83 5 18 100
#> 84 5 19 100
#> 85 5 20 100
#> 86 6 7 0
#> 87 6 8 0
#> 88 6 9 0
#> 89 6 10 0
#> 90 6 11 100
#> 91 6 12 100
#> 92 6 13 100
#> 93 6 14 100
#> 94 6 15 100
#> 95 6 16 100
#> 96 6 17 100
#> 97 6 18 100
#> 98 6 19 100
#> 99 6 20 100
#> 100 7 8 0
#> 101 7 9 0
#> 102 7 10 0
#> 103 7 11 100
#> 104 7 12 100
#> 105 7 13 100
#> 106 7 14 100
#> 107 7 15 100
#> 108 7 16 100
#> 109 7 17 100
#> 110 7 18 100
#> 111 7 19 100
#> 112 7 20 100
#> 113 8 9 0
#> 114 8 10 0
#> 115 8 11 100
#> 116 8 12 100
#> 117 8 13 100
#> 118 8 14 100
#> 119 8 15 100
#> 120 8 16 100
#> 121 8 17 100
#> 122 8 18 100
#> 123 8 19 100
#> 124 8 20 100
#> 125 9 10 0
#> 126 9 11 100
#> 127 9 12 100
#> 128 9 13 100
#> 129 9 14 100
#> 130 9 15 100
#> 131 9 16 100
#> 132 9 17 100
#> 133 9 18 100
#> 134 9 19 100
#> 135 9 20 100
#> 136 10 11 100
#> 137 10 12 100
#> 138 10 13 100
#> 139 10 14 100
#> 140 10 15 100
#> 141 10 16 100
#> 142 10 17 100
#> 143 10 18 100
#> 144 10 19 100
#> 145 10 20 100
#> 146 11 12 0
#> 147 11 13 0
#> 148 11 14 0
#> 149 11 15 0
#> 150 11 16 0
#> 151 11 17 0
#> 152 11 18 0
#> 153 11 19 0
#> 154 11 20 0
#> 155 12 13 0
#> 156 12 14 0
#> 157 12 15 0
#> 158 12 16 0
#> 159 12 17 0
#> 160 12 18 0
#> 161 12 19 0
#> 162 12 20 0
#> 163 13 14 0
#> 164 13 15 0
#> 165 13 16 0
#> 166 13 17 0
#> 167 13 18 0
#> 168 13 19 0
#> 169 13 20 0
#> 170 14 15 0
#> 171 14 16 0
#> 172 14 17 0
#> 173 14 18 0
#> 174 14 19 0
#> 175 14 20 0
#> 176 15 16 0
#> 177 15 17 0
#> 178 15 18 0
#> 179 15 19 0
#> 180 15 20 0
#> 181 16 17 0
#> 182 16 18 0
#> 183 16 19 0
#> 184 16 20 0
#> 185 17 18 0
#> 186 17 19 0
#> 187 17 20 0
#> 188 18 19 0
#> 189 18 20 0
#> 190 19 20 0
#>
#> $c_score
#> [1] 52.63158
#>
#> $c_score_s2
#> [1] 5263.158
#>