spacodi.by.nodes
is a function for testing the null expectation of uniform diversity turnover across nodes of a phylogeny.spacodi.by.nodes(sp.plot, phy, sp.parm = "Bst", obs.only = FALSE, return.all = TRUE, n.rep = 10, method = "1s", parm = NULL, dmat = NULL, rand.test = TRUE, r.rep = 10000, ...)
as.spacodi
)phylo
; see read.tree
"Ist","Pst","Bst","PIst"
or analogs for trait data); see Detailssp.parms
s for the empirical data are returned"1a", "2x", and "3x"
(see Details)"3t"
sp.parm
s is performedspacodi.matrices
spacodi.by.nodes
returns a list of three elements:
observed.sp.parm
: estimated sp.parm
for nodes of the tree (either all nodes, if return.all=TRUE
or for only
those nodes for which sp.parm
is non-null)
expected.sp.parm
: expected sp.parm
for all nodes of the emprical data for which sp.parm
is calculable; nodes in
this element of the output array are row names
randomization.test
: results from randomization tests of sp.parm
for each node. Note: if randomization test is used,
some randomization iterations may return NA for particular nodes (see details above). The tally of valid expected
sp.parm
s from permutation is recorded as a column in this element (i.e., randomization.test$valid.comparisons
).
Be wary of significant results that are based off few valid comparisons.
spacodi.by.nodes
is a function to conduct randomization tests on estimated and observed sp.parms
s through time. See spacodi.calc
for further information on the possible estimators to use, whether considering phylogenetic or trait diversity.
spacodi.by.nodes
computes measures of community structure for nodes of
a phylogeny that subtend greater than two species and where nodes subtend species
that are sampled in multiple plots.
Note: whether for the empirical data or for permuted datasets, if fewer than two species are sampled in a given plot, the plot will be dynamically
removed from the dataset. This behavior can be controlled directly in spacodi.calc
with the prune
option.
For significance testing, permuted datasets may be generated by one of several methods
:
method = "1a"
shuffling based on abundance classes of species (see resamp.1a
);
requires specification of abund.class.ratio
as a parm
method = "1s"
shuffling of abundances across entire dataset (see resamp.1s
)
method = "2s"
shuffling of abundances across species but within plots (see resamp.2s
)
method = "2x"
Gotelli swapping of abundances for pairs of species and within a pair of plots (see resamp.2x
);
requires specification of level
as a parm
method = "3i"
shuffling of abundances within species and among plots (see resamp.3i
)
method = "3t"
shuffling of abundances to adjacent plots but within species (see resamp.3t
); if supplied, dmat
is used to condition abundance shuffling, where closer plots, on average, have higher likelihoods of abundances being swapped
method = "3x"
Gotelli swapping of abundances for pairs of plots and within a pair of species (see resamp.3x
);
requires specification of level
as a parm
spacodi.calc
for interpretation of results; resamp.test
; randomizeMatrix
# load a species-by-plots matrix, along with a tree
data(sp.example)
attributes(sp.example)
attach(sp.example)
spl
phy
# generate a plot of observed and expected Bst
sp.permut<-spacodi.by.nodes(sp.plot=spl, phy=phy, n.rep=35)
sp.permut$randomization.test
# plot observed and expected Bst
spacodi.permutplot(spacodi.permutations=sp.permut, envelope=FALSE)
Run the code above in your browser using DataLab