cca, rda and
capscale return similar result objects. Function
capscale inherits from rda and rda
inherits from cca. This inheritance structure is due to
historic reasons: cca was the first of these implemented in
vegan. Hence the nomenclature in cca.object reflects
cca. This help page describes the internal structure of the
cca object for programmers.
cca object has the following elements:
cca. In rda, item colsum contains standard
deviations of species and rowsum is NA. If some data
were removed in na.action, the row sums of excluded
observations are in item rowsum.excluded in cca (but
not in rda). The rowsum.excluded add to the total
(one) of rowsum. cca and
NA in rda.terms component of the
formula. This is missing if the ordination was not called
with formula.terms which is like the terms component above, but
lists conditions and constraints similarly; xlev
which lists the factor levels, and ordered which is
TRUE to ordered factors.
This is produced by vegan internal function
ordiTerminfo, and it is needed in
predict.cca with newdata. This is missing if
the ordination was not called with formula.na.action if missing
values in constraints were handled by na.omit or
na.exclude (or NULL if there were no missing
values). This is a vector of indices of missing value rows in the
original data and a class of the action, usually either
"omit" or "exclude".CCA and pCCA are
NULL. If they are specified but have zero rank and zero
eigenvalue (e.g., due to aliasing), they have a standard structure
like described below, but the result scores have zero columns, but
the correct number of rows. The residual component is never
NULL, and if there is no residual variation (like in
overdefined model), its scores have zero columns. The standard
print command does not show NULL components, but it
prints zeros for zeroed components. Items pCCA, CCA
and CA contain following items:aliasalias.cca does not access this item
directly, but it finds the aliased variables and their defining
equations from the QR item.biplotCCA.centroidsCCA. Missing if the ordination was not
called with formula.eigCCA and CA.envcentrepCCA and in CCA.FitpCCA.QRqr.
The constrained ordination
algorithm is based on QR decomposition of constraints and
conditions (environmental data). The environmental data
are first centred in rda or weighted and centred in
cca. The QR decomposition is used in many functions that
access cca results, and it can be used to find many items
that are not directly stored in the object. For examples, see
coef.cca, coef.rda,
vif.cca, permutest.cca,
predict.cca, predict.rda,
calibrate.cca. For possible uses of this component,
see qr. In pCCA and CCA.rankqrankpCCA and
CCA components. Only in CCA.tot.chireal.tot.chicapscale, these will be included in tot.chi,
and the sum of positive eigenvalues will be given in these items.imaginary.chi, imaginary.rank,
imaginary.u.eigcapscale. Only in CA item and only if
negative eigenvalues were found in capscale.ucca object, but they
are made when the object is accessed with functions like
scores.cca, summary.cca or
plot.cca, or their rda variants. Only in
CCA and CA. In the CCA component these are
the so-called linear combination scores. vna.action that lists the
omitted species. Only in CCA and CA.wacca) or
weighted sums (rda) of
v with weights Xbar, but the multiplying effect of
eigenvalues removed. These often are known as WA scores in
cca. Only in CCA.wa.excluded, u.excludedna.action = na.exclude in CCA and CA
components if these could be calculated.XbarCCA this is after possible pCCA or
after partialling out the effects of conditions, and in CA
after both pCCA and CCA. In cca the
standardization is Chi-square, and in rda centring
and optional scaling by species standard deviations using function
scale.na.action
was set to na.exclude or na.omit, the
result will have some extra items:
subsetTRUE for included cases).na.actionna.action which is a named vector of indices of
removed items. The class of the vector is either "omit" or
"exclude" as set by na.action. The na.action
is applied after subset so that the indices refer to the subset
data.residuals.zombienobs.cca to find
the number of observations.rowsum.excludedcca.CCA$wa.excludedna.action was na.exclude and the
scores could be calculated. The scores cannot be found for
capscale and in partial ordination.CA$u.excludedcapscale and dbrda. Function
capscale uses rda and returns its result
object, but it may add some items depending on its arguments: real.tot.chitot.chi gives the total
inertia with negative eigenvalues. This item is given for the
whole model and for each component pCCA, CCA and
CA if there are negative eigenvalues.metaMDSdistmetaMDSdist = TRUE.sqrt.distTRUE if squareroots of
dissimilarities were used.acadd = TRUE.addac, either
"lingoes" or "cailliez" (Legendre & Legendre
2012).adjustcapscale, section Notes.GpCCA and
CCA, and for CCA it is the residual $G$ after
pCCA.dbrda does not use rda but
provides a parallel implementation for dissimilarities. Its result
output is very similar to capscale described above
with the following differences: Xbar, vNA because they cannot be
calculated from dissimilarities.FitpCCA is from Gower double centred
dissimilarities G instead of Xbar (that does not
exist).GpCCA, CCA and
CA components. It always gives the transformed
dissimilarities as they enter the stage of analysis, i.e.,
before applying conditions or constraints.eigCCA
and pCCA.uimaginary.u. The number of columns of real scores
(positive eigenvalues) is given in item poseig. There is
no imaginary.u.eig.cca
objects are described in this section in cca. Also for
a hacker interface, it may be better to use following low level
functions to access the results:
scores.cca (which also scales results),
predict.cca (which can also use newdata),
fitted.cca, residuals.cca,
alias.cca, coef.cca,
model.frame.cca, model.matrix.cca,
deviance.cca, eigenvals.cca,
RsquareAdj.cca,
weights.cca, nobs.cca, or rda
variants of these functions.
You can use as.mlm to cast a cca.object into
result of multiple response
linear model (lm) in order to more easily find some
statistics (which in principle could be directly found from the
cca object as well). This section in cca gives a more complete list of
methods to handle the constrained ordination result object.
# Some species will be missing in the analysis, because only a subset
# of sites is used below.
data(dune)
data(dune.env)
mod <- cca(dune[1:15,] ~ ., dune.env[1:15,])
# Look at the names of missing species
attr(mod$CCA$v, "na.action")
# Look at the names of the aliased variables:
mod$CCA$alias
# Access directly constrained weighted orthonormal species and site
# scores, constrained eigenvalues and margin sums.
spec <- mod$CCA$v
sites <- mod$CCA$u
eig <- mod$CCA$eig
rsum <- mod$rowsum
csum <- mod$colsum
Run the code above in your browser using DataLab