stat_boxplotstat_boxplot(mapping=NULL, data=NULL, geom="boxplot", position="dodge", na.rm=FALSE, coef=1.5, ...)
Calculate components of box and whisker plot
This page describes stat_boxplot, see layer and qplot for how to create a complete plot from individual components.
What do you think of the documentation? Please let me know by filling out this short online survey.
The following aesthetics can be used with stat_boxplot. Aesthetics are mapped to variables in the data with the aes function: stat_boxplot(aes(x = var)). Note that you do not need quotes around the variable name.
Scales control how the variable is mapped to the aesthetic and are listed after each aesthetic.
| Aesthetic | Default | Related scales |
|---|---|---|
| x | required | continuous, date, datetime, discrete |
| y | required | continuous, date, datetime, discrete |
Layers are divided into groups by the group aesthetic. By default this is set to the interaction of all categorical variables present in the plot.
To use these variables in an aesthetic mapping, you need to surrond them with .., like aes(x = ..output..). This tells ggplot that the variable isn't the original dataset, but has been created by the statistic.
width, width of boxplotymin, lower whisker, lower hinge - 1.5 * IQRlower, lower hinge, 25% quantilemiddle, median, 50% quantileupper, upper hinge, 75% quantileymax, upper whisker, upper hinge + 1.5 * IQRParameters control the appearance of the stat. In addition to the parameters listed below (if any), any aesthetic can be used as a parameter, in which case it will override any aesthetic mapping.
width: NULLna.rm: NULLcoef: NULL...: ignored This function returns a layer object.
> # See geom_boxplot for examples
What do you think of the documentation? Please let me know by filling out this short online survey.