boxPlot | R Documentation |
Produces a truncated, simple, Tukey, or extended box plot.
boxPlot(..., group = NULL, Box = list(type = "truncated", show.counts = TRUE, nobox = 5, width = "Auto", fill = "none", truncated = c(10, 90)), yaxis.log = FALSE, yaxis.range = c(NA, NA), ylabels = "Auto", xlabels = "Auto", xlabels.rotate = FALSE, xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA)) ## S3 method for class 'numeric' boxPlot(..., group = NULL, Box = list(type = "truncated", show.counts = TRUE, nobox = 5, width = "Auto", fill = "none", truncated = c(10, 90)), yaxis.log = FALSE, yaxis.range = c(NA, NA), ylabels = "Auto", xlabels = "Auto", xlabels.rotate = FALSE, xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA)) ## S3 method for class 'list' boxPlot(..., group = NULL, Box = list(type = "truncated", show.counts = TRUE, nobox = 5, width = "Auto", fill = "none", truncated = c(10, 90)), yaxis.log = FALSE, yaxis.range = c(NA, NA), ylabels = "Auto", xlabels = "Auto", xlabels.rotate = FALSE, xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA)) ## S3 method for class 'data.frame' boxPlot(..., group = NULL, Box = list(type = "truncated", show.counts = TRUE, nobox = 5, width = "Auto", fill = "none", truncated = c(10, 90)), yaxis.log = FALSE, yaxis.range = c(NA, NA), ylabels = "Auto", xlabels = "Auto", xlabels.rotate = FALSE, xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA))
... |
the data to plot. Missing values are permitted and excluded from the summary statistics computations. |
group |
any vector containing distinct values to create groups of data for
individual box plots. Missing values are not permitted. Valid only when a single
numeric vector is supplied for |
Box |
control parameters for the box. See Details. |
yaxis.log |
logical, if |
yaxis.range |
set y-axis range. See Details. |
ylabels |
set up y-axis labels. See |
xlabels |
set up x-axis labels. Must be either "Auto" or a character vector of the x-axis labels. |
xlabels.rotate |
logical, if |
xtitle |
the x-axis title (also called x-axis caption). |
ytitle |
the y-axis title (also called y-axis caption). |
caption |
the figure caption |
margin |
set the plot area margins, in units of lines of text. Generally
all NA or the output from |
If group is numeric, then the boxes will be plotted along a continuous
numeric axis. Otherwise the x-axis will be discrete groups.
Box
is
a list with these components:
the type of boxtplot:
"simple" the whiskers extend to the minimum and maximum of the data,
"truncated" the whiskers extend to percentiles defined by truncated
,
"tukey" the standard "Tukey" boxplot as described by Helsel and Hirsch (200),
and "extended" the whisker extend to
percentiles defined by truncated
and values outside of that range are
shown;
show the number of observations used to compute the boxplot statistics;
only individual values are shown if the number of observations is less than or equal to this value;
the width of the box, in inches;
The color of the filled box or "none" for no fill;
the percentiles to use for the truncated boxplot.
For linear axes, the range can be set to virtually any pair of values. For log axes, the choice of range is more resticted—for less than one log-cycle, powers of whole numbers can be used; from 1 to about 3 log cycles, the choices should be powers of 3 or 10; and for more than 3 log cycles, the range sould be expressed only in powers of 10.
Information about the graph.
A call should be made to setPage
to set up the graphics
environment before calling boxPlot
.
If yaxis.log
is set to
TRUE
, then the quartiles and interquartile range are computed from
the log-transformed values rather then the untransformed values, which is
common for other box plots. Those computations are in agreement with the box
plots generated in the QWGRAPH component of the QWDATA module in the
National Water Information System (NWIS) described by Dennis Helsel's 1989
Branch of Systems Analysis Technical Memorandum No. 89.01, available online
at https://water.usgs.gov/admin/memo/BSA/BSA89.01.pdf. Those
computations have a significant effect on the appearance the whiskers and
outside values of the Tukey box plot and are motivated by the general
assumption of a log-normal distribution for most water-quality constituents.
Helsel, D.R. and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.
setPage
, dotPlot
## Not run: set.seed(1) Xbig <- rnorm(100) setGD() # The simple type box plot boxPlot(Xbig, Box=list(type="simple")) # For more details of boxPlot see vignette(topic="BoxPlots", package="smwrGraphs") vignette(topic="GraphSetup", package="smwrGraphs") demo(topic="Coplot-simpleBoxPlot", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.