hiersimu
).adipart(...)
## S3 method for class 'default':
adipart(y, x, index=c("richness", "shannon", "simpson"),
weights=c("unif", "prop"), relative = FALSE, nsimul=99, ...)
## S3 method for class 'formula':
adipart(formula, data, index=c("richness", "shannon", "simpson"),
weights=c("unif", "prop"), relative = FALSE, nsimul=99, ...)hiersimu(...)
## S3 method for class 'default':
hiersimu(y, x, FUN, location = c("mean", "median"),
relative = FALSE, drop.highest = FALSE, nsimul=99, ...)
## S3 method for class 'formula':
hiersimu(formula, data, FUN, location = c("mean", "median"),
relative = FALSE, drop.highest = FALSE, nsimul=99, ...)
y
, columns
coding the levels of sampling hierarchy. The number of groups within
the hierarchy must decrease from left to right. If x
is missing,
function performs an overall decy ~ x
,
where y
is the community data matrix with samples as rows and
species as column. Right hand side (x
) must be grouping variables
referring to levels of samplingformula
. If missing, variables are looked
in the global environment."unif"
for uniform weights,
"prop"
for weighting proportional to sample abundances to use
in weighted averaging of individual alpha values within strata of a
given level of the sampling hierarchy.TRUE
then alpha and beta diversity
values are given relative to the value of gamma for function
adipart
.matr
is not of
class 'permat'. If nsimul = 0
, only the FUN
argument
is evaluated. It is thus possible to reuse the statistic values
without using a null model.hiersimu
. This must be
fully specified, because currently other arguments cannot be passed
to this function via ...
.FUN
evaluates only arrays with at least 2 dimensions, highest
level should be dropped, or not selected at all.method
, thin
or
burnin
arguments for oecosimu
."adipart"
or "hiersimu"
with same
structure as oecosimu
objects. At the highest sampling level, the diversity components are calculated
as
Average alpha components can be weighted uniformly
(weight="unif"
) to calculate it as simple average, or
proportionally to sample abundances (weight="prop"
) to
calculate it as weighted average as follows
The implementation of additive diversity partitioning in
adipart
follows Crist et al. 2003. It is based on species
richness ($S$, not $S-1$), Shannon's and Simpson's diversity
indices stated as the index
argument.
The expected diversity components are calculated nsimul
times
by individual based randomisation of the community data matrix. This
is done by the "r2dtable"
method in oecosimu
by
default.
hiersimu
works almost in the same way as adipart
, but
without comparing the actual statistic values returned by FUN
to the highest possible value (cf. gamma diversity). This is so,
because in most of the cases, it is difficult to ensure additive
properties of the mean statistic values along the hierarchy.
Lande, R. (1996). Statistics and partitioning of species diversity, and similarity among multiple communities. Oikos, 76, 5--13.
oecosimu
for permutation settings and
calculating $p$-values. multipart
for multiplicative
diversity partitioning.## NOTE: 'nsimul' argument usually needs to be >= 99
## here much lower value is used for demonstration
data(mite)
data(mite.xy)
data(mite.env)
## Function to get equal area partitions of the mite data
cutter <- function (x, cut = seq(0, 10, by = 2.5)) {
out <- rep(1, length(x))
for (i in 2:(length(cut) - 1))
out[which(x > cut[i] & x <= cut[(i + 1)])] <- i
return(out)}
## The hierarchy of sample aggregation
levsm <- with(mite.xy, data.frame(
l1=1:nrow(mite),
l2=cutter(y, cut = seq(0, 10, by = 2.5)),
l3=cutter(y, cut = seq(0, 10, by = 5)),
l4=cutter(y, cut = seq(0, 10, by = 10))))
## Let's see in a map
par(mfrow=c(1,3))
plot(mite.xy, main="l1", col=as.numeric(levsm$l1)+1, asp = 1)
plot(mite.xy, main="l2", col=as.numeric(levsm$l2)+1, asp = 1)
plot(mite.xy, main="l3", col=as.numeric(levsm$l3)+1, asp = 1)
par(mfrow=c(1,1))
## Additive diversity partitioning
adipart(mite, index="richness", nsimul=19)
adipart(mite ~ ., levsm, index="richness", nsimul=19)
## Hierarchical null model testing
## diversity analysis (similar to adipart)
hiersimu(mite, FUN=diversity, relative=TRUE, nsimul=19)
hiersimu(mite ~., levsm, FUN=diversity, relative=TRUE, nsimul=19)
## Hierarchical testing with the Morisita index
morfun <- function(x) dispindmorisita(x)$imst
hiersimu(mite ~., levsm, morfun, drop.highest=TRUE, nsimul=19)
Run the code above in your browser using DataLab