
varpart(Y, X, ..., data, transfo, scale = FALSE)
showvarparts(parts, labels, ...)
## S3 method for class 'varpart234':
plot(x, cutoff = 0, digits = 1, ...)
~
and then defining the model, (2) name of a
single numeric variable, or (3) name of data X
.Y
(community data) using
decostand
. All alternatives in decostand
can be
used, and those preserving Euclidean metric include
"hellinger"
Y
be standardized to unit variancevarpart
result.cutoff
will not be displayed.varpart
returns an
object of class "varpart"
with items scale
and
transfo
(can be missing) which hold information on
standardizations, tables
which contains names of explanatory
tables, and call
with the function call
. The
function varpart
calls function varpart2
,
varpart3
or varpart4
which return an object of class
"varpart234"
and saves its result in the item part
.
The items in this object are:Y
.showvarparts
).fract
,
indfract
, contr1
and contr2
are all data frames with
items:
fract
and this is NA
in other items.}
Testable
, and this field is
TRUE
. In that case the fraction label also gives the
specification of the testable RDA model.}Y
into components
accounted for by two to four explanatory tables and their combined
effects. If Y
is a multicolumn data frame or
matrix, the partitioning is based on redundancy analysis (RDA, see
rda
), and if Y
is a single variable, the
partitioning is based on linear regression. A simplified, fast
version of RDA is used (function simpleRDA2
). The actual
calculations are done in fucntions varpart2
to varpart4
,
but these are not intended to be called directly by the user. The function primarily uses adjusted R squares to assess the partitions explained by the explanatory tables and their combinations, because this is the only unbiased method (Peres-Neto et al., submitted). The raw R squares for basic fractions are also displayed, but these are biased estimates of variation explained by the explanatory table.
The identifiable fractions are designated by lower case alphabets. The
meaning of the symbols can be found in the separate document
"partionining.pdf" (which can be read using vegandocs
),
or can be displayed graphically using function
showvarparts
.
A fraction is testable if it can be directly
expressed as an RDA model. In these cases the printed output also
displays the corresponding RDA model using notation where explanatory
tables after |
are conditions (partialled out; see
rda
for details). Although single fractions can be
testable, this does not mean that all fractions simultaneously can be
tested, since there number of testable fractions is higher than
the number of estimated models.
An abridged explanation of the alphabetic symbols for the individual
fractions follows, but computational details should be checked in
"partitioning.pdf" (readable with vegandocs
) or in the
source code.
With two explanatory tables, the fractions explained
uniquely by each of the two tables are [a]
and
[c]
, and their joint effect
is [b]
following Borcard et al. (1992).
With three explanatory tables, the fractions explained uniquely
by each of the three tables are
[a]
to [c]
, joint fractions between two tables are
[d]
to [f]
, and the joint fraction between all three
tables is [g]
.
With four explanatory tables, the fractions explained uniquely by each
of the four tables are [a]
to [d]
, joint fractions between two tables are [e]
to
[j]
, joint fractions between three variables are [k]
to
[n]
, and the joint fraction between all four tables is
[o]
.
There is a plot
function that displays the Venn
diagram and labels each intersection (individual fraction) with the
adjusted R squared if this is higher than cutoff
. A helper
function showvarpart
displays the fraction labels.
Borcard, D., P. Legendre & P. Drapeau. 1992. Partialling out the spatial component of ecological variation. Ecology 73: 1045--1055.
Legendre, P. & L. Legendre. 1998. Numerical ecology, 2nd English edition. Elsevier Science BV, Amsterdam.
(b) Reference on transformations for species data
Legendre, P. and E. D. Gallagher. 2001. Ecologically meaningful transformations for ordination of species data. Oecologia 129: 271--280.
(c) Reference on adjustment of the bimultivariate redundancy statistic
Peres-Neto, P., P. Legendre, S. Dray and D. Borcard. 2006. Variation partioning of species data matrices: estimation and comparison of fractions. Ecology 87: 2614--2625.
rda
and
anova.cca
. For data transformation, see
decostand
. Function inertcomp
gives
(unadjusted) components of variation for each species or site
separately.data(mite)
data(mite.env)
data(mite.pcnm)
## See detailed documentation:
vegandocs("partition")
# Two explanatory matrices -- Hellinger-transform Y
# Formula shortcut "~ ." means: use all variables in 'data'.
mod <- varpart(mite, ~ ., mite.pcnm, data=mite.env, transfo="hel")
mod
showvarparts(2)
plot(mod)
# Alternative way of to conduct this partitioning
# Change the data frame with factors into numeric model matrix
mm <- model.matrix(~ SubsDens + WatrCont + Substrate + Shrub + Topo, mite.env)[,-1]
mod <- varpart(decostand(mite, "hel"), mm, mite.pcnm)
# Test fraction [a] using RDA:
rda.result <- rda(decostand(mite, "hell"), mm, mite.pcnm)
anova(rda.result, step=200, perm.max=200)
# Three explanatory matrices
mod <- varpart(mite, ~ SubsDens + WatrCont, ~ Substrate + Shrub + Topo,
mite.pcnm, data=mite.env, transfo="hel")
mod
showvarparts(3)
plot(mod)
# An alternative formulation of the previous model using
# matrices mm1 amd mm2 and Hellinger transformed species data
mm1 <- model.matrix(~ SubsDens + WatrCont, mite.env)[,-1]
mm2 <- model.matrix(~ Substrate + Shrub + Topo, mite.env)[, -1]
mite.hel <- decostand(mite, "hel")
mod <- varpart(mite.hel, mm1, mm2, mite.pcnm)
# Use RDA to test fraction [a]
rda.result <- rda(mite.hel, mm1, cbind(mm2, mite.pcnm))
anova(rda.result, step=200, perm.max=200)
# Four explanatory tables
mod <- varpart(mite, ~ SubsDens + WatrCont, ~Substrate + Shrub + Topo,
mite.pcnm[,1:11], mite.pcnm[,12:22], data=mite.env, transfo="hel")
mod
plot(mod)
# Show values for all partitions by putting 'cutoff' low enough:
plot(mod, cutoff = -Inf, cex = 0.7)
Run the code above in your browser using DataLab