Compute the beta diversity between all pairs of sites for a specific presence-absence matrix.
Arguments
- x
a
pa
object or an R object to a coerced to one (seeec_as_pa()
).- methods
a vector of two-letters strings describing the methods te be used. Values should be taken among
ra
,bc
,wi
andja
(see details).
Details
Currently ra
stands for raw and returns the number of occurrence.
Additional values are
bc
: Bray-Curtis index,wi
: Wishart index,ja
: Jaccard index.
References
Legendre, P., and De Caceres M.. Beta Diversity as the Variance of Community Data: Dissimilarity Coefficients and Partitioning. Ecology Letters (2013).
Koleff, P., Gaston, K. J. & Lennon, J. J. Measuring beta diversity for presence-absence data. Journal of Animal Ecology (2003).
Examples
mat <- ec_generate_pa(20, 10, .4)
ec_betadiversity(mat)
#> site1 site2 bc
#> 1 sit_01 sit_02 0.4285714
#> 2 sit_01 sit_03 0.5555556
#> 3 sit_01 sit_04 0.7500000
#> 4 sit_01 sit_05 0.7142857
#> 5 sit_01 sit_06 0.5555556
#> 6 sit_01 sit_07 0.3333333
#> 7 sit_01 sit_08 0.5555556
#> 8 sit_01 sit_09 0.7500000
#> 9 sit_01 sit_10 1.0000000
#> 10 sit_01 sit_11 0.6666667
#> 11 sit_01 sit_12 0.7500000
#> 12 sit_01 sit_13 0.6000000
#> 13 sit_01 sit_14 0.7777778
#> 14 sit_01 sit_15 0.4285714
#> 15 sit_01 sit_16 0.7142857
#> 16 sit_01 sit_17 0.4000000
#> 17 sit_01 sit_18 0.6666667
#> 18 sit_01 sit_19 0.5000000
#> 19 sit_01 sit_20 0.5555556
#> 20 sit_02 sit_03 0.7500000
#> 21 sit_02 sit_04 1.0000000
#> 22 sit_02 sit_05 0.3333333
#> 23 sit_02 sit_06 1.0000000
#> 24 sit_02 sit_07 0.5000000
#> 25 sit_02 sit_08 0.5000000
#> 26 sit_02 sit_09 0.7142857
#> 27 sit_02 sit_10 1.0000000
#> 28 sit_02 sit_11 1.0000000
#> 29 sit_02 sit_12 1.0000000
#> 30 sit_02 sit_13 0.5555556
#> 31 sit_02 sit_14 0.7500000
#> 32 sit_02 sit_15 0.3333333
#> 33 sit_02 sit_16 0.6666667
#> 34 sit_02 sit_17 0.7777778
#> 35 sit_02 sit_18 0.6000000
#> 36 sit_02 sit_19 0.4285714
#> 37 sit_02 sit_20 0.7500000
#> 38 sit_03 sit_04 0.5555556
#> 39 sit_03 sit_05 0.7500000
#> 40 sit_03 sit_06 0.6000000
#> 41 sit_03 sit_07 0.4000000
#> 42 sit_03 sit_08 0.4000000
#> 43 sit_03 sit_09 0.5555556
#> 44 sit_03 sit_10 1.0000000
#> 45 sit_03 sit_11 0.7142857
#> 46 sit_03 sit_12 0.5555556
#> 47 sit_03 sit_13 0.4545455
#> 48 sit_03 sit_14 0.6000000
#> 49 sit_03 sit_15 0.7500000
#> 50 sit_03 sit_16 0.5000000
#> 51 sit_03 sit_17 0.6363636
#> 52 sit_03 sit_18 0.7142857
#> 53 sit_03 sit_19 0.7777778
#> 54 sit_03 sit_20 0.6000000
#> 55 sit_04 sit_05 0.7142857
#> 56 sit_04 sit_06 0.1111111
#> 57 sit_04 sit_07 0.3333333
#> 58 sit_04 sit_08 0.5555556
#> 59 sit_04 sit_09 0.2500000
#> 60 sit_04 sit_10 0.3333333
#> 61 sit_04 sit_11 0.3333333
#> 62 sit_04 sit_12 0.0000000
#> 63 sit_04 sit_13 0.4000000
#> 64 sit_04 sit_14 0.5555556
#> 65 sit_04 sit_15 0.7142857
#> 66 sit_04 sit_16 0.7142857
#> 67 sit_04 sit_17 0.4000000
#> 68 sit_04 sit_18 0.6666667
#> 69 sit_04 sit_19 0.5000000
#> 70 sit_04 sit_20 0.5555556
#> 71 sit_05 sit_06 0.7500000
#> 72 sit_05 sit_07 0.5000000
#> 73 sit_05 sit_08 0.2500000
#> 74 sit_05 sit_09 0.7142857
#> 75 sit_05 sit_10 0.6000000
#> 76 sit_05 sit_11 0.6000000
#> 77 sit_05 sit_12 0.7142857
#> 78 sit_05 sit_13 0.5555556
#> 79 sit_05 sit_14 0.5000000
#> 80 sit_05 sit_15 0.6666667
#> 81 sit_05 sit_16 0.6666667
#> 82 sit_05 sit_17 0.7777778
#> 83 sit_05 sit_18 1.0000000
#> 84 sit_05 sit_19 0.4285714
#> 85 sit_05 sit_20 0.7500000
#> 86 sit_06 sit_07 0.4000000
#> 87 sit_06 sit_08 0.6000000
#> 88 sit_06 sit_09 0.3333333
#> 89 sit_06 sit_10 0.4285714
#> 90 sit_06 sit_11 0.4285714
#> 91 sit_06 sit_12 0.1111111
#> 92 sit_06 sit_13 0.4545455
#> 93 sit_06 sit_14 0.4000000
#> 94 sit_06 sit_15 0.7500000
#> 95 sit_06 sit_16 0.7500000
#> 96 sit_06 sit_17 0.2727273
#> 97 sit_06 sit_18 0.7142857
#> 98 sit_06 sit_19 0.5555556
#> 99 sit_06 sit_20 0.4000000
#> 100 sit_07 sit_08 0.4000000
#> 101 sit_07 sit_09 0.5555556
#> 102 sit_07 sit_10 0.7142857
#> 103 sit_07 sit_11 0.4285714
#> 104 sit_07 sit_12 0.3333333
#> 105 sit_07 sit_13 0.2727273
#> 106 sit_07 sit_14 0.6000000
#> 107 sit_07 sit_15 0.5000000
#> 108 sit_07 sit_16 0.7500000
#> 109 sit_07 sit_17 0.4545455
#> 110 sit_07 sit_18 0.4285714
#> 111 sit_07 sit_19 0.3333333
#> 112 sit_07 sit_20 0.4000000
#> 113 sit_08 sit_09 0.5555556
#> 114 sit_08 sit_10 0.7142857
#> 115 sit_08 sit_11 0.4285714
#> 116 sit_08 sit_12 0.5555556
#> 117 sit_08 sit_13 0.6363636
#> 118 sit_08 sit_14 0.6000000
#> 119 sit_08 sit_15 0.5000000
#> 120 sit_08 sit_16 0.5000000
#> 121 sit_08 sit_17 0.4545455
#> 122 sit_08 sit_18 1.0000000
#> 123 sit_08 sit_19 0.3333333
#> 124 sit_08 sit_20 0.8000000
#> 125 sit_09 sit_10 0.6666667
#> 126 sit_09 sit_11 0.6666667
#> 127 sit_09 sit_12 0.2500000
#> 128 sit_09 sit_13 0.6000000
#> 129 sit_09 sit_14 0.5555556
#> 130 sit_09 sit_15 0.4285714
#> 131 sit_09 sit_16 0.4285714
#> 132 sit_09 sit_17 0.6000000
#> 133 sit_09 sit_18 0.6666667
#> 134 sit_09 sit_19 0.5000000
#> 135 sit_09 sit_20 0.7777778
#> 136 sit_10 sit_11 0.5000000
#> 137 sit_10 sit_12 0.3333333
#> 138 sit_10 sit_13 0.5000000
#> 139 sit_10 sit_14 0.7142857
#> 140 sit_10 sit_15 1.0000000
#> 141 sit_10 sit_16 1.0000000
#> 142 sit_10 sit_17 0.5000000
#> 143 sit_10 sit_18 1.0000000
#> 144 sit_10 sit_19 0.6666667
#> 145 sit_10 sit_20 0.7142857
#> 146 sit_11 sit_12 0.3333333
#> 147 sit_11 sit_13 0.7500000
#> 148 sit_11 sit_14 0.7142857
#> 149 sit_11 sit_15 0.6000000
#> 150 sit_11 sit_16 0.6000000
#> 151 sit_11 sit_17 0.5000000
#> 152 sit_11 sit_18 1.0000000
#> 153 sit_11 sit_19 0.3333333
#> 154 sit_11 sit_20 0.7142857
#> 155 sit_12 sit_13 0.4000000
#> 156 sit_12 sit_14 0.5555556
#> 157 sit_12 sit_15 0.7142857
#> 158 sit_12 sit_16 0.7142857
#> 159 sit_12 sit_17 0.4000000
#> 160 sit_12 sit_18 0.6666667
#> 161 sit_12 sit_19 0.5000000
#> 162 sit_12 sit_20 0.5555556
#> 163 sit_13 sit_14 0.4545455
#> 164 sit_13 sit_15 0.7777778
#> 165 sit_13 sit_16 0.7777778
#> 166 sit_13 sit_17 0.5000000
#> 167 sit_13 sit_18 0.5000000
#> 168 sit_13 sit_19 0.6000000
#> 169 sit_13 sit_20 0.2727273
#> 170 sit_14 sit_15 0.7500000
#> 171 sit_14 sit_16 0.5000000
#> 172 sit_14 sit_17 0.6363636
#> 173 sit_14 sit_18 0.7142857
#> 174 sit_14 sit_19 0.5555556
#> 175 sit_14 sit_20 0.2000000
#> 176 sit_15 sit_16 0.3333333
#> 177 sit_15 sit_17 0.5555556
#> 178 sit_15 sit_18 0.6000000
#> 179 sit_15 sit_19 0.1428571
#> 180 sit_15 sit_20 0.7500000
#> 181 sit_16 sit_17 0.7777778
#> 182 sit_16 sit_18 1.0000000
#> 183 sit_16 sit_19 0.4285714
#> 184 sit_16 sit_20 0.7500000
#> 185 sit_17 sit_18 0.7500000
#> 186 sit_17 sit_19 0.4000000
#> 187 sit_17 sit_20 0.4545455
#> 188 sit_18 sit_19 0.6666667
#> 189 sit_18 sit_20 0.4285714
#> 190 sit_19 sit_20 0.5555556