5
5
\usage {
6
6
geom_boxplot(mapping = NULL , data = NULL , stat = " boxplot" ,
7
7
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
+ ... )
9
10
}
10
11
\arguments {
11
- \item {outlier.colour }{colour for outlying points }
12
+ \item {outlier.colour }{colour for outlying points }
12
13
13
- \item {outlier.shape }{shape of outlying points }
14
+ \item {outlier.shape }{shape of outlying points }
14
15
15
- \item {outlier.size }{size of outlying points }
16
+ \item {outlier.size }{size of outlying points }
16
17
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. }
21
23
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 )}
24
26
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 ). }
28
32
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. }
31
37
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 . }
34
40
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. }
37
43
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. }
41
51
}
42
52
\description {
43
53
The 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.
58
68
See McGill et al. (1978 ) for more details.
59
69
}
60
70
\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" )}
63
73
}
64
74
\examples {
65
75
\donttest {
@@ -116,6 +126,10 @@ b <- ggplot(abc, aes(x = X1, ymin = `0\%`, lower = `25\%`, middle = `50\%`, uppe
116
126
b + geom_boxplot(stat = " identity" )
117
127
b + geom_boxplot(stat = " identity" ) + coord_flip()
118
128
b + 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 )
119
133
}
120
134
}
121
135
\references {
0 commit comments