The R Project SVN R

Rev

Rev 30855 | Rev 35869 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30855 Rev 32316
Line 88... Line 88...
88
}
88
}
89
\details{
89
\details{
90
  The generic function \code{boxplot} currently has a default method
90
  The generic function \code{boxplot} currently has a default method
91
  (\code{boxplot.default}) and a formula interface (\code{boxplot.formula}).
91
  (\code{boxplot.default}) and a formula interface (\code{boxplot.formula}).
92
 
92
 
-
 
93
  If multiple groups are supplied either as multiple arguments or via a
-
 
94
  formula, parallel boxplots will be plotted, in the order of the
-
 
95
  arguments or the order of the levels of the factor (see
-
 
96
  \code{\link{factor}}).
-
 
97
  
93
  Missing values are ignored when forming boxplots.
98
  Missing values are ignored when forming boxplots.
94
}
99
}
95
\value{
100
\value{
96
  List with the following components:
101
  List with the following components:
97
  \item{stats}{a matrix, each column contains the extreme of the lower
102
  \item{stats}{a matrix, each column contains the extreme of the lower
Line 128... Line 133...
128
# *add* notches (somewhat funny here):
133
# *add* notches (somewhat funny here):
129
boxplot(count ~ spray, data = InsectSprays,
134
boxplot(count ~ spray, data = InsectSprays,
130
        notch = TRUE, add = TRUE, col = "blue")
135
        notch = TRUE, add = TRUE, col = "blue")
131
 
136
 
132
boxplot(decrease ~ treatment, data = OrchardSprays,
137
boxplot(decrease ~ treatment, data = OrchardSprays,
133
        log = "y", col="bisque")
138
        log = "y", col = "bisque")
134
 
139
 
135
rb <- boxplot(decrease ~ treatment, data = OrchardSprays, col="bisque")
140
rb <- boxplot(decrease ~ treatment, data = OrchardSprays, col="bisque")
136
title("Comparing boxplot()s and non-robust mean +/- SD")
141
title("Comparing boxplot()s and non-robust mean +/- SD")
137
 
142
 
138
mn.t <- tapply(OrchardSprays$decrease, OrchardSprays$treatment, mean)
143
mn.t <- tapply(OrchardSprays$decrease, OrchardSprays$treatment, mean)
Line 152... Line 157...
152
 
157
 
153
## Using 'at = ' and adding boxplots -- example idea by Roger Bivand :
158
## Using 'at = ' and adding boxplots -- example idea by Roger Bivand :
154
 
159
 
155
boxplot(len ~ dose, data = ToothGrowth,
160
boxplot(len ~ dose, data = ToothGrowth,
156
        boxwex = 0.25, at = 1:3 - 0.2,
161
        boxwex = 0.25, at = 1:3 - 0.2,
157
        subset= supp == "VC", col="yellow",
162
        subset = supp == "VC", col = "yellow",
158
        main="Guinea Pigs' Tooth Growth",
163
        main = "Guinea Pigs' Tooth Growth",
159
        xlab="Vitamin C dose mg",
164
        xlab = "Vitamin C dose mg",
160
        ylab="tooth length", ylim=c(0,35))
165
        ylab = "tooth length", ylim = c(0,35))
161
boxplot(len ~ dose, data = ToothGrowth, add = TRUE,
166
boxplot(len ~ dose, data = ToothGrowth, add = TRUE,
162
        boxwex = 0.25, at = 1:3 + 0.2,
167
        boxwex = 0.25, at = 1:3 + 0.2,
163
        subset= supp == "OJ", col="orange")
168
        subset = supp == "OJ", col = "orange")
164
legend(2, 9, c("Ascorbic acid", "Orange juice"),
169
legend(2, 9, c("Ascorbic acid", "Orange juice"),
165
       fill = c("yellow", "orange"))
170
       fill = c("yellow", "orange"))
166
 
171
 
167
## more examples in  help(bxp)
172
## more examples in  help(bxp)
168
}
173
}