plot_box()
builds a simple, pre-themed boxplot on one variable alone or grouped by another variable.
Usage
plot_box(
data,
formula,
fill = "grey80",
breaks = NULL,
orient = c("vertical", "horizontal"),
title = NULL,
...
)
Arguments
- data
A data frame.
- formula
Variables entered in formula notation. Either
~var
for a one-variable boxplot orvar1~var2
for a grouped boxplot wherevar2
is a grouping variable.- fill
The fill color for the boxplot. Entered as a character.
- breaks
A vector of length 3 (start, stop, step) specifying how the x-scale should be broken up.
- orient
The orientation for the plot (either "vertical", the default, or "horizontal"). As a shortcut, "v" and "h" may be used.
- title
An override for the title of the plot. A sensible default is provided.
- ...
Extra title arguments passed on to
ggformula::gf_labs()
(which feeds toggplot2::ggplot()
).