Note that we have removed variable dfs from the environmental data frame and
created a new object called env2. Apart from being a spatial rather than
environmental variable, dfs, the distance from the source, is highly correlated
with several other explanatory variables which are ecologically more explicit and
therefore more interesting, like discharge, hardness and nitrogen content.
6.3.2.2 RDA Using vegan
vegan allows the computation of an RDA in two different ways. The simplest
syntax is to list the names of the data frames involved separated by commas:
simpleRDA <- rda(Y, X, W)
where Y is the response matrix, X is the matrix of explanatory variables, and W is
an optional matrix of covariables (variables whose variation is to be controlled in a
partial analysis, see Sect. 6.3.2.5).
This call, although simple, has some limitations. Its main drawback is that it does
not allow qualitative variables of class “factor” to be included in the explanatory and
covariable matrices. Therefore, in all but the simplest applications, it is better to use
the formula interface:
formulaRDA <- rda(Y ~ var1 + factorA + var2*var3 + Condition(var4),
data = XWdata)
In this example, Y is the response matrix; the constraint includes a quantitative
variable (var1), a factor (factorA), an interaction term between variables 2 and
3, whereas the effect of var4 is partialled out (so this is actually a partial RDA).
The explanatory variables and the covariable are in object XWdata, which must have
class data.frame.
This is the same kind of formula as used in lm() and other R functions devoted
to regression. We will use it in the example below. For more information about this
topic, consult the rda() documentation file.
Let us compute an RDA of the Hellinger-transformed fish species data,
constrained by the environmental variables contained in env3, i.e. all environmental variables except dfs, and variable slo coded as a factor.
(spe.rda <- rda(spe.hel ~ ., env3))
summary(spe.rda)
# Scaling 2 (default)
208
6 Canonical Ordination
Précédent

- 220/444

Suivant