[ top | up ]
Box Plots
Syntax
boxplot(..., range=1.5, width, varwidth=false,
notch=false, names, plot=true, col, fill=null)
Arguments
...
|
either vectors or a list containing the
values to appear in the boxplots
(NAs are allowed).
range
|
this determines how far the plot whiskers
extend out from the box.
If range is positive,
the whiskers extend to the most extreme data point which
is no more than range times the interquartile range
from the box.
A value of zero causes the whiskers to extend to the data extremes.
width
|
a vector giving the relative widths of the boxes
making up the plot.
| varwidth
|
if varwidth is true, the boxes
are drawn with widths proportional to the square-roots
of the number of observations in the groups.
notch
|
if notch is true, a notch is drawn in each
side of the boxes. If the notches of two plots do not
overlap then the medians are significantly different at the
5 percent level.
name
|
group labels which while be printed under
each boxplot.
| plot
|
if plot is true (the default) then
a boxplot is produced.
If not, the summaries which the boxplots are based on are
returned.
col
|
an optional vector of colors for the outlines of
the boxplots. The values in col are recycled if
the length of col is less than the number of plots.
fill
|
if fill is non-null it is assumed to
contain colors to be used to fill the bodies of the box plots.
| | | | | | |
Description
boxplot produces box-and-whisker plots of the given values.
The data which are used to construct plots may be passed as
a sequence of vector arguments, or as a single list of vectors.
The command split can be used to create
the right kind of list.
Values
A list with one component corresponding to each plot.
The components are themselves lists with named components
as follows:
stats
|
a vector containing the extreme of the
lower whisker, the lower hinge, the median, the upper hinge
and the extreme of the upper whisker.
|
n
|
the number of observations in the sample.
|
conf
|
the lower and upper extremes of the notch.
|
out
|
the values of any data points which lie beyond the
extremes of the whiskers.
Examples
boxplot(precipitation)
boxplot(split(warpbreaks,col(warpbreaks,factor=true)))
|