data(varespec)
data(varechem)
library(MASS)
ord <- metaMDS(varespec)
(fit <- envfit(ord, varechem, perm = 1000))
plot(ord)
plot(fit)
plot(fit, p.max = 0.05, col = "red")
## Adding fitted arrows to CCA. We use "lc" scores, and draw
## arrows separately to control their lengths.
ord <- cca(varespec ~ Al + P + K, varechem)
plot(ord, display = c("sp", "lc"), type="p")
text(ord, display = "bp", col = "red", arrow=2)
fit <- envfit(ord, varechem, perm = 1000, display = "lc")
plot(fit, arrow = 2, p.max = 0.05)
## Class variables, formula interface, and displaying the
## inter-class variability with `ordispider'
data(dune)
data(dune.env)
attach(dune.env)
ord <- cca(dune)
fit <- envfit(ord ~ Moisture + A1, dune.env)
plot(ord, type = "n")
ordispider(ord, Moisture, col="skyblue")
points(ord, display = "sites", col = as.numeric(Moisture), pch=16)
plot(fit, arrow=2, cex=1.2)
Run the code above in your browser using DataLab