These objects are imported from other packages. Follow the links below to see their documentation.
- ggplot2
Usage
# S3 method for mct
autoplot(object, rotation = 0, size = 4, label_height = 0.1, ...)
# S3 method for design
autoplot(
object,
rotation = 0,
size = 4,
margin = FALSE,
palette = "default",
...
)
Arguments
- object
An object to create a plot for. Currently objects from the
mct.out()
ordesign()
functions with class "mct" or "design" respectively are supported.- rotation
Rotate the text output as Treatments within the plot. Allows for easier reading of long treatment labels. Number between 0 and 360 (inclusive) - default 0
- size
Increase or decrease the text size within the plot for treatment labels. Numeric with default value of 4.
- label_height
Height of the text labels above the upper error bar on the plot. Default is 0.1 (10%) of the difference between upper and lower error bars above the top error bar.
- ...
Other arguments to be passed through.
- margin
Logical (default
FALSE
). A value ofFALSE
will expand the plot to the edges of the plotting area i.e. remove white space between plot and axes.- palette
A string specifying the colour scheme to use for plotting. Default is equivalent to "Spectral". Colour blind friendly palettes can also be provided via options
"colour blind"
(or"color blind"
, both equivalent to"viridis"
),"magma"
,"inferno"
,"plasma"
or"cividis"
. Other palettes fromscales::brewer_pal()
are also possible.
Examples
dat.aov <- aov(Petal.Width ~ Species, data = iris)
output <- mct.out(dat.aov, classify = "Species")
autoplot(output, label_height = 0.5)
des.out <- design(type = "crd", treatments = c(1, 5, 10, 20),
reps = 5, nrows = 4, ncols = 5, seed = 42, plot = FALSE)
#> Source of Variation df
#> =============================================
#> treatments 3
#> Residual 16
#> =============================================
#> Total 19
autoplot(des.out)
# Colour blind friendly colours
autoplot(des.out, palette = "colour-blind")
# Alternative colour scheme
autoplot(des.out, palette = "plasma")