beta.div(Y, method = "hellinger", sqrt.D = FALSE, samp = TRUE, nperm = 999, adj = TRUE, save.D = FALSE, clock = FALSE)
data.frame
or matrix
."hellinger"
, "chord"
, "chisquare"
,
"profiles"
, "percentdiff"
, "ruzicka"
,
"divergence"
, "canberra"
, "whittaker"
,
"wishart"
, "kulczynski"
, "jaccard"
, "sorensen"
,
"ochiai"
, "ab.jaccard"
, "ab.sorensen"
,
"ab.ochiai"
, "ab.simpson"
, "euclidean"
. See Details.
Names can be abbreviated to a non-ambiguous set of first letters. Default:
method="hellinger"
.sqrt.D=TRUE
, the dissimilarities in matrix D are
square-rooted before computation of SStotal, BDtotal and LCBD. This
transformation may be useful for methods "manhattan"
,
"whittaker"
, "divergence"
, "canberra"
,
"percentdiff"
, "ruzicka"
, "wishart"
since square-root
transformation of the dissimilarities makes these D matrices Euclidean.
sqrt.D
has no incidence on calculations through methods
"euclidean"
, "profiles"
, "hellinger"
, "chord"
,
"chisquare"
since no D matrix is computed in those cases. "jaccard"
, "sorensen"
, "ochiai"
, that
function produces the dissimilarity matrix in the form sqrt(D), which is
Euclidean.samp=TRUE
, the abundance-based distances (ab.jaccard,
ab.sorensen, ab.ochiai, ab.simpson) are computed for sample data. If
samp=FALSE
, they are computed for true population data.adj=TRUE
save.D=TRUE
, the distance matrix will appear in the
output list.clock=TRUE
, the computation time is printed. Useful
when nperm is large.SStotal_BDtotal
: Total sum of squares and total beta diversity [=
Var(Y)] of the data matrix. BDtotal statistics computed with the same D
index are comparable among data sets having the same or different numbers
of sampling units (n), provided that they are of the same size or represent
the same sampling effort. SCBD
: Vector of Species
contributions to beta diversity (SCBD), if computed. LCBD
:
Vector of Local contributions to beta diversity (LCBD) for the sites. p.LCBD
: P-values associated with the LCBD indices. method
: Method selected. note
: Notes indicate whether
the selected coefficient is Euclidean or not. D
: The distance
matrix if save.D=TRUE
. "hellinger"
, "chord"
, "profiles"
, which have maximum values of
sqrt(2), BDtotal produces an index in the range [0, 1] with a maximum value
of 1. "euclidean"
, "profiles"
,
"hellinger"
, "chord"
, "chisquare"
. No transformation
of the data is computed when the method is "euclidean"
. For methods
"profiles"
, "hellinger"
, "chord"
, "chisquare"
,
the algorithm begins with computation of the same-name transformation of
the community data (Legendre and Gallagher 2001; Legendre and Legendre
2012, Section 7.7); SStotal and BDtotal are then computed for the
transformed data, followed by calculation of the SCBD and LCBD indices.
sqrt.D = TRUE
, the computation of SStotal is equivalent to summing
the distances instead of the squared distances. Choices are:
"whittaker"
, "divergence"
, "canberra"
,
"percentdiff"
, "ruzicka"
, "wishart"
,
"kulczynski"
, "ab.jaccard"
, "ab.sorensen"
,
"ab.ochiai"
, "ab.simpson"
, "jaccard"
,
"sorensen"
, "ochiai"
. Equations for these dissimilarities are
presented in Table 1 of Legendre and De Cáceres (2013). The Ružička index
is described in Legendre (2014); this coefficient is suitable for beta
diversity studies. See Chao et al. (2006) for details about the
abundance-based (ab) coefficients."profiles"
, "hellinger"
,
"chord"
, "chisquare"
transformations available in this
function. One can use either the log(y+1 transformation (log1p
function of base
), or Anderson et al. (2006) special log
transformation available in vegan
: decostand(mat, "log",
logbase=10)
. The Jaccard, Sørensen and Ochiai coefficients are the binary
forms of 10 of the 12 dissimilarity coefficients (including the Ružička
index) that are suitable for beta diversity assessment. The equivalences
are described in Legendre and De Cáceres (2013, Table 1). These popular
coefficients can be computed directly using function beta.div
without going to the trouble of applying the quantitative forms of these
coefficients to data reduced to presence-absence form. beta.div
produces the dissimilarity matrix in the form sqrt(D), which is Euclidean.
Hence for these three coefficients, function beta.div
should be used
with option sqrt.D=FALSE
.
Species contributions to beta diversity (SCBD indices for the species) are computed
for the untransformed or transformed raw data, but they cannot be computed for
dissimilarity matrices.
Local contributions to beta diversity (LCBD indices) represent
the degree of uniqueness of the sites in terms of their species
compositions. They can be computed in all cases: raw (not recommended) or
transformed data, as well as dissimilarity matrices. See Legendre and De
Cáceres (2013) for details. LCBD indices are tested for significance by
random, independent permutations within the columns of Y. This permutation
method tests H0 that the species are distributed at random, independently
of one another, among the sites, while preserving the species abundance
distributions in the observed data. See Legendre and De Cáceres (2013) for
discussion. This version of beta.div
calls computer code written in C to speed up
computation, especially for the permutation tests of the LCBD indices.
Legendre, P. 2014. Interpreting the replacement and richness difference components of beta diversity. Global Ecology and Biogeography 23: 1324-1334.
Legendre, P. and M. De Cáceres. 2013. Beta diversity as the variance of community data: dissimilarity coefficients and partitioning. Ecology Letters 16: 951-963.
Legendre, P. and E. D. Gallagher, E.D. 2001. Ecologically meaningful transformations for ordination of species data. Oecologia 129: 271–280.
Legendre, P. and Legendre, L. 2012. Numerical Ecology. 3rd English edition. Elsevier Science BV, Amsterdam.
if(require("vegan", quietly = TRUE) & require("adegraphics", quietly = TRUE)){
data(mite)
res = beta.div(mite, "hellinger", nperm=999)
# Plot a map of the LCDB indices using the Cartesian coordinates
data(mite.xy)
s.value(mite.xy, res$LCBD, symbol = "circle", col = c("white", "brown"), main="Map of mite LCBD")
### Example using the mite abundance data and the percentage difference dissimilarity
res = beta.div(mite, "percentdiff", nperm=999, clock=TRUE)
# Plot a map of the LCDB indices
signif = which(res$p.LCBD <= 0.05) # Which are the significant LCDB indices?
nonsignif = which(res$p.LCBD > 0.05) # Which are the non-significant LCDB indices?
g1 <- s.value(mite.xy[signif,], res$LCBD[signif], ppoint.alpha = 0.5, plegend.drawKey = FALSE,
symbol = "circle", col = c("white", "red"), main="Map of mite LCBD (red = significant indices)")
g2 <- s.value(mite.xy[nonsignif,], res$LCBD[nonsignif], ppoint.alpha = 0.5,
symbol = "circle", col = c("white", "blue"))
g2+g1
}
Run the code above in your browser using DataLab