autoplot.permustats | R Documentation |
Alternatives for lattice graphics functions
vegan::densityplot.permustats()
,
vegan::densityplot.permustats()
and
vegan::boxplot.permustats()
.
## S3 method for class 'permustats'
autoplot(
object,
plot = c("box", "violin", "density", "qqnorm"),
scale = FALSE,
facet = FALSE,
gg.params = list(),
...
)
object |
object from |
plot |
character; the type of plot, or a geom from ggplot2. |
scale |
logical; use standardized effect sizes (SES)? |
facet |
logical; should the plot be faceted by |
gg.params |
list; arguments passed to function drawing the box-like
object. Depending on argument |
... |
Other parameters passed to functions (ignored). |
Function fortify()
returns a data frame with variables permutations
(numeric) and term
(factor labelling the permutation). The result of
fortify()
can be used to custom build diagnostic plots. autoplot()
provides basic plots of vegan::permustats()
objects with limited
flexibility.
data(dune, dune.env)
mod <- cca(dune ~ A1 + Management + Moisture, dune.env)
(ano <- anova(mod, by = "onedf"))
pstat <- permustats(ano)
head(fortify(pstat))
autoplot(pstat, "box")
if (requireNamespace("ggplot2")) {
library("ggplot2")
# avoid overplotting x-axis text
autoplot(pstat, "violin") +
scale_x_discrete(guide = guide_axis(n.dodge = 2))
autoplot(pstat, "qqnorm", facet = TRUE) +
geom_qq_line()
}
autoplot(pstat, "density", facet = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.