## See add1.cca for another example
### Dune data
data(dune)
data(dune.env)
mod0 <- rda(dune ~ 1, dune.env) # Model with intercept only
mod1 <- rda(dune ~ ., dune.env) # Model with all explanatory variables
## With scope present, the default direction is "both"
ordistep(mod0, scope = formula(mod1), perm.max = 200)
## Example without scope. Default direction is "backward"
ordistep(mod1, perm.max = 200)
## Example of ordistep, forward
ordistep(mod0, scope = formula(mod1), direction="forward", perm.max = 200)
### Mite data
data(mite)
data(mite.env)
mite.hel = decostand(mite, "hel")
mod0 <- rda(mite.hel ~ 1, mite.env) # Model with intercept only
mod1 <- rda(mite.hel ~ ., mite.env) # Model with all explanatory variables
## Example of ordiR2step with default direction = "both"
## (This never goes "backward" but evaluates included terms.)
step.res <- ordiR2step(mod0, mod1, perm.max = 200)
step.res$anova # Summary table
## Example of ordiR2step with direction = "forward"
step.res <- ordiR2step(mod0, scope = formula(mod1), direction="forward")
step.res$anova # Summary table
Run the code above in your browser using DataLab