55\usage {
66geom_boxplot(mapping = NULL , data = NULL , stat = " boxplot" ,
77 position = " dodge" , outlier.colour = " black" , outlier.shape = 16 ,
8- outlier.size = 2 , notch = FALSE , notchwidth = 0.5 , ... )
8+ outlier.size = 2 , notch = FALSE , notchwidth = 0.5 , varwidth = FALSE ,
9+ ... )
910}
1011\arguments {
11- \item {outlier.colour }{colour for outlying points }
12+ \item {outlier.colour }{colour for outlying points }
1213
13- \item {outlier.shape }{shape of outlying points }
14+ \item {outlier.shape }{shape of outlying points }
1415
15- \item {outlier.size }{size of outlying points }
16+ \item {outlier.size }{size of outlying points }
1617
17- \item {notch }{if \code {FALSE } (default ) make a standard box plot. If
18- \code {TRUE }, make a notched box plot. Notches are used to compare groups ;
19- if the notches of two boxes do not overlap , this is strong evidence that
20- the medians differ. }
18+ \item {notch }{if \code {FALSE } (default ) make a standard
19+ box plot. If \code {TRUE }, make a notched box plot.
20+ Notches are used to compare groups ; if the notches of two
21+ boxes do not overlap , this is strong evidence that the
22+ medians differ. }
2123
22- \item {notchwidth }{for a notched box plot , width of the notch relative to
23- the body (default 0.5 )}
24+ \item {notchwidth }{for a notched box plot , width of the
25+ notch relative to the body (default 0.5 )}
2426
25- \item {mapping }{The aesthetic mapping , usually constructed with
26- \code {\link {aes }} or \code {\link {aes_string }}. Only needs to be set
27- at the layer level if you are overriding the plot defaults. }
27+ \item {varwidth }{if \code {FALSE } (default ) make a standard
28+ box plot. If \code {TRUE }, boxes are drawn with widths
29+ proportional to the square - roots of the number of
30+ observations in the groups (possibly weighted , using the
31+ \code {weight } aesthetic ). }
2832
29- \item {data }{A layer specific dataset - only needed if you want to override
30- the plot defaults. }
33+ \item {mapping }{The aesthetic mapping , usually constructed
34+ with \code {\link {aes }} or \code {\link {aes_string }}. Only
35+ needs to be set at the layer level if you are overriding
36+ the plot defaults. }
3137
32- \item {stat }{ The statistical transformation to use on the data for this
33- layer . }
38+ \item {data }{ A layer specific dataset - only needed if you
39+ want to override the plot defaults . }
3440
35- \item {position }{The position adjustment to use for overlapping points
36- on this layer }
41+ \item {stat }{The statistical transformation to use on the
42+ data for this layer. }
3743
38- \item {... }{other arguments passed on to \code {\link {layer }}. This can
39- include aesthetics whose values you want to set , not map. See
40- \code {\link {layer }} for more details. }
44+ \item {position }{The position adjustment to use for
45+ overlapping points on this layer }
46+
47+ \item {... }{other arguments passed on to
48+ \code {\link {layer }}. This can include aesthetics whose
49+ values you want to set , not map. See \code {\link {layer }}
50+ for more details. }
4151}
4252\description {
4353The upper and lower " hinges" correspond to the first and third quartiles
@@ -58,8 +68,8 @@ This gives a roughly 95% confidence interval for comparing medians.
5868See McGill et al. (1978 ) for more details.
5969}
6070\section {Aesthetics }{
61-
62- \ Sexpr [ results = rd , stage = build ]{ ggplot2 ::: rd_aesthetics( " geom " , " boxplot" )}
71+ \ Sexpr [ results = rd , stage = build ]{ ggplot2 ::: rd_aesthetics( " geom " ,
72+ " boxplot" )}
6373}
6474\examples {
6575\donttest {
@@ -116,6 +126,10 @@ b <- ggplot(abc, aes(x = X1, ymin = `0\%`, lower = `25\%`, middle = `50\%`, uppe
116126b + geom_boxplot(stat = " identity" )
117127b + geom_boxplot(stat = " identity" ) + coord_flip()
118128b + geom_boxplot(aes(fill = X1 ), stat = " identity" )
129+
130+ # Using varwidth
131+ p + geom_boxplot(varwidth = TRUE )
132+ qplot(factor (cyl ), mpg , data = mtcars , geom = " boxplot" , varwidth = TRUE )
119133}
120134}
121135\references {
0 commit comments