| Line 6... |
Line 6... |
| 6 |
notch = FALSE, names.x, data = sys.frame(sys.parent()),
|
6 |
notch = FALSE, names.x, data = sys.frame(sys.parent()),
|
| 7 |
plot = TRUE, border = par("fg"), col = NULL, log = "",
|
7 |
plot = TRUE, border = par("fg"), col = NULL, log = "",
|
| 8 |
pars = NULL)
|
8 |
pars = NULL)
|
| 9 |
}
|
9 |
}
|
| 10 |
\arguments{
|
10 |
\arguments{
|
| 11 |
\item{x, \dots}{the data from which the boxplots are to be produced.
|
11 |
\item{x, \dots}{the data from which the boxplots are to be produced.
|
| 12 |
The data can be specified as separate vectors, each
|
12 |
The data can be specified as separate vectors, each
|
| 13 |
corresponding to a component boxplot, or as a single list
|
13 |
corresponding to a component boxplot, or as a single list
|
| 14 |
containing such vectors. Alternatively a symbolic specification
|
14 |
containing such vectors. Alternatively a symbolic specification
|
| 15 |
of the form \code{x ~ g} can be given, indicating that the
|
15 |
of the form \code{x ~ g} can be given, indicating that the
|
| 16 |
observations in the vector \code{x} are to be grouped according
|
16 |
observations in the vector \code{x} are to be grouped according
|
| 17 |
to the levels of the \code{\link{factor}} \code{g}. In this
|
17 |
to the levels of the \code{\link{factor}} \code{g}. In this
|
| 18 |
case the argument \code{data} can be used to provide values for
|
18 |
case the argument \code{data} can be used to provide values for
|
| 19 |
the variables in the specification. \code{\link{NA}}s are
|
19 |
the variables in the specification. \code{\link{NA}}s are
|
| 20 |
allowed in the data.}
|
20 |
allowed in the data.}
|
| 21 |
\item{range}{this determines how far the plot whiskers extend out
|
21 |
\item{range}{this determines how far the plot whiskers extend out
|
| 22 |
from the box. If \code{range} is positive, the whiskers extend
|
22 |
from the box. If \code{range} is positive, the whiskers extend
|
| 23 |
to the most extreme data point which is no more than
|
23 |
to the most extreme data point which is no more than
|
| 24 |
\code{range} times the interquartile range from the box. A value
|
24 |
\code{range} times the interquartile range from the box. A value
|
| 25 |
of zero causes the whiskers to extend to the data extremes.}
|
25 |
of zero causes the whiskers to extend to the data extremes.}
|
| 26 |
\item{width}{a vector giving the relative widths of the boxes making
|
26 |
\item{width}{a vector giving the relative widths of the boxes making
|
| 27 |
up the plot.}
|
27 |
up the plot.}
|
| 28 |
\item{varwidth}{if \code{varwidth} is \code{TRUE}, the boxes are
|
28 |
\item{varwidth}{if \code{varwidth} is \code{TRUE}, the boxes are
|
| 29 |
drawn with widths proportional to the square-roots of the number
|
29 |
drawn with widths proportional to the square-roots of the number
|
| 30 |
of observations in the groups.}
|
30 |
of observations in the groups.}
|
| 31 |
\item{notch}{if \code{notch} is \code{TRUE}, a notch is drawn in
|
31 |
\item{notch}{if \code{notch} is \code{TRUE}, a notch is drawn in
|
| 32 |
each side of the boxes. If the notches of two plots do not
|
32 |
each side of the boxes. If the notches of two plots do not
|
| 33 |
overlap then the medians are significantly different at the 5
|
33 |
overlap then the medians are significantly different at the 5
|
| 34 |
percent level.}
|
34 |
percent level.}
|
| 35 |
\item{names}{group labels which while be printed under each
|
35 |
\item{names}{group labels which will be printed under each boxplot.}
|
| 36 |
boxplot.}
|
- |
|
| 37 |
\item{data}{\code{\link{data.frame}}, \code{\link{list}}, or
|
36 |
\item{data}{\code{\link{data.frame}}, \code{\link{list}}, or
|
| 38 |
\code{\link{environment}} in which variable names are evaluated
|
37 |
\code{\link{environment}} in which variable names are evaluated
|
| 39 |
when \code{x} is a formula.}
|
38 |
when \code{x} is a formula.}
|
| 40 |
\item{plot}{if \code{TRUE} (the default) then a boxplot is
|
39 |
\item{plot}{if \code{TRUE} (the default) then a boxplot is
|
| 41 |
produced. If not, the summaries which the boxplots are based on
|
40 |
produced. If not, the summaries which the boxplots are based on
|
| 42 |
are returned.}
|
41 |
are returned.}
|
| 43 |
\item{border}{an optional vector of colors for the outlines of the
|
42 |
\item{border}{an optional vector of colors for the outlines of the
|
| 44 |
boxplots. The values in \code{border} are recycled if the
|
43 |
boxplots. The values in \code{border} are recycled if the
|
| 45 |
length of \code{border} is less than the number of plots.}
|
44 |
length of \code{border} is less than the number of plots.}
|
| 46 |
\item{col}{if \code{col} is non-null it is assumed to contain colors
|
45 |
\item{col}{if \code{col} is non-null it is assumed to contain colors
|
| 47 |
to be used to col the bodies of the box plots.}
|
46 |
to be used to col the bodies of the box plots.}
|
| 48 |
\item{log}{character indicating if x or y or both coordinates should
|
47 |
\item{log}{character indicating if x or y or both coordinates should
|
| 49 |
be plotted in log scale.}
|
48 |
be plotted in log scale.}
|
| 50 |
\item{pars, \dots}{graphical parameters can also be passed as
|
49 |
\item{pars, \dots}{graphical parameters can also be passed as
|
| 51 |
arguments to \code{boxplot}.}
|
50 |
arguments to \code{boxplot}.}
|
| 52 |
}
|
51 |
}
|
| 53 |
\description{
|
52 |
\description{
|
| 54 |
Produce box-and-whisker plot(s) of the given (grouped) values.
|
53 |
Produce box-and-whisker plot(s) of the given (grouped) values.
|
| 55 |
}
|
54 |
}
|
| 56 |
\value{
|
55 |
\value{
|
| 57 |
List with one component corresponding to each plot. The
|
56 |
List with one component corresponding to each plot. The
|
| 58 |
components are themselves lists with named components as follows:
|
57 |
components are themselves lists with named components as follows:
|
| 59 |
\item{stats}{a vector containing the extreme of the lower whisker,
|
58 |
\item{stats}{a vector containing the extreme of the lower whisker,
|
| 60 |
the lower hinge, the median, the upper hinge and the extreme of
|
59 |
the lower hinge, the median, the upper hinge and the extreme of
|
| 61 |
the upper whisker.}
|
60 |
the upper whisker.}
|
| 62 |
\item{n}{the number of observations in the sample.}
|
61 |
\item{n}{the number of observations in the sample.}
|
| 63 |
\item{conf}{the lower and upper extremes of the notch.}
|
62 |
\item{conf}{the lower and upper extremes of the notch.}
|
| 64 |
\item{out}{the values of any data points which lie beyond the
|
63 |
\item{out}{the values of any data points which lie beyond the
|
| 65 |
extremes of the whiskers.}
|
64 |
extremes of the whiskers.}
|
| 66 |
}
|
65 |
}
|
| 67 |
\seealso{
|
66 |
\seealso{
|
| 68 |
\code{\link{boxplot.stats}} which does the computation,
|
67 |
\code{\link{boxplot.stats}} which does the computation,
|
| 69 |
\code{\link{bxp}} for the plotting, and \code{\link{stripplot}} for an
|
68 |
\code{\link{bxp}} for the plotting, and \code{\link{stripplot}} for an
|
| 70 |
alternative (with small data sets).
|
69 |
alternative (with small data sets).
|
| 71 |
|
70 |
|
| 72 |
\code{\link{plot.default}} for some high-level plotting parameters.
|
71 |
\code{\link{plot.default}} for some high-level plotting parameters.
|
| 73 |
}
|
72 |
}
|
| 74 |
\examples{
|
73 |
\examples{
|
| 75 |
data(InsectSprays)
|
74 |
data(InsectSprays)
|
| 76 |
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
|
75 |
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
|
| 77 |
|
76 |
|