Draws boxplots for a numeric variable, optionally grouped by a categorical variable. Group means and a reference line for the overall mean can optionally be overlaid.
Usage
plotBox(x, ...)
# Default S3 method
plotBox(
x,
g = NULL,
main = NULL,
xlab = "",
ylab = "",
ylim = NULL,
col = NULL,
grid = TRUE,
means = TRUE,
stamp = TRUE,
...
)
# S3 method for class 'formula'
plotBox(
formula,
data,
subset,
na.action = na.omit,
main = NULL,
xlab = "",
ylab = "",
ylim = NULL,
col = NULL,
grid = TRUE,
stamp = TRUE,
...
)Arguments
- x
numeric vector, or a formula of the form
x ~ g.- ...
graphical parameters. Parameters recognized by the internal graphics framework are applied via
par(); remaining arguments are forwarded tographics::boxplot().- g
optional grouping variable (ignored if a formula is used).
- main
main title of the plot.
- xlab
label for the x-axis.
- ylab
label for the y-axis.
- ylim
numeric vector of length 2 specifying the y-axis limits. If
NULL(default), the range ofxis used.- col
vector of colors. If
NULL, a palette is generated automatically.- grid
controls drawing of the background grid. Can be:
TRUE: draw grid with default settingsFALSE,NULL, orNA: suppress grida named list: arguments passed to
graphics::grid(), e.g.list(col = "red", nx = NA, ny = NULL)for vertical lines only
- means
controls drawing of group means and an overall mean reference line. Can be:
TRUE: draw with default settingsFALSE,NULL, orNA: suppressa named list: arguments passed to the internal means function. Supported arguments:
col,pch,cex,lcol,lty,lwd.
- stamp
controls the corner stamp.
.useTheme(default) resolves togetTheme()$stamp.TRUE/FALSE/NULL, or an explicit string, as for.withGraphicsState()(internal).- formula
A formula of the form
y ~ group.- data
an optional data frame containing variables in the formula.
- subset
optional expression indicating which observations to use.
- na.action
a function specifying how missing values are handled.
Details
Optional plot components are controlled using
bedrock::callIf() semantics:
TRUE: draw with defaultsFALSE,NULL, orNA: suppress componentnamed list: customize component arguments
See also
graphics::boxplot(),
bedrock::callIf()
Other plot.univariate:
plotArea(),
plotBar(),
plotCatDist(),
plotDens(),
plotDensBox(),
plotDot(),
plotECDF(),
plotFdist(),
plotLines(),
plotQQ(),
plotViolin()
