The R Project SVN R

Rev

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

Rev 68948 Rev 70587
Line 1... Line 1...
1
% File src/library/graphics/man/boxplot.Rd
1
% File src/library/graphics/man/boxplot.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2014 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{boxplot}
6
\name{boxplot}
7
\alias{boxplot}
7
\alias{boxplot}
8
\alias{boxplot.default}
8
\alias{boxplot.default}
Line 12... Line 12...
12
  Produce box-and-whisker plot(s) of the given (grouped) values.
12
  Produce box-and-whisker plot(s) of the given (grouped) values.
13
}
13
}
14
\usage{
14
\usage{
15
boxplot(x, \dots)
15
boxplot(x, \dots)
16
 
16
 
17
\method{boxplot}{formula}(formula, data = NULL, \dots, subset, na.action = NULL)
17
\method{boxplot}{formula}(formula, data = NULL, \dots, subset, na.action = NULL,
-
 
18
        drop = FALSE, sep = ".", lex.order = FALSE)
18
 
19
 
19
\method{boxplot}{default}(x, \dots, range = 1.5, width = NULL, varwidth = FALSE,
20
\method{boxplot}{default}(x, \dots, range = 1.5, width = NULL, varwidth = FALSE,
20
        notch = FALSE, outline = TRUE, names, plot = TRUE,
21
        notch = FALSE, outline = TRUE, names, plot = TRUE,
21
        border = par("fg"), col = NULL, log = "",
22
        border = par("fg"), col = NULL, log = "",
22
        pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5),
23
        pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5),
Line 31... Line 32...
31
  \item{subset}{an optional vector specifying a subset of observations
32
  \item{subset}{an optional vector specifying a subset of observations
32
    to be used for plotting.}
33
    to be used for plotting.}
33
  \item{na.action}{a function which indicates what should happen
34
  \item{na.action}{a function which indicates what should happen
34
    when the data contain \code{NA}s.  The default is to ignore missing
35
    when the data contain \code{NA}s.  The default is to ignore missing
35
    values in either the response or the group.}
36
    values in either the response or the group.}
-
 
37
  \item{drop, sep, lex.order}{passed to \code{\link{split.default}}, see there.}
36
  \item{x}{for specifying data from which the boxplots are to be
38
  \item{x}{for specifying data from which the boxplots are to be
37
    produced. Either a numeric vector, or a single list containing such
39
    produced. Either a numeric vector, or a single list containing such
38
    vectors. Additional unnamed arguments specify further data
40
    vectors. Additional unnamed arguments specify further data
39
    as separate vectors (each corresponding to a component boxplot).
41
    as separate vectors (each corresponding to a component boxplot).
40
    \code{\link{NA}}s are allowed in the data.}
42
    \code{\link{NA}}s are allowed in the data.}
Line 183... Line 185...
183
        boxwex = 0.25, at = 1:3 + 0.2,
185
        boxwex = 0.25, at = 1:3 + 0.2,
184
        subset = supp == "OJ", col = "orange")
186
        subset = supp == "OJ", col = "orange")
185
legend(2, 9, c("Ascorbic acid", "Orange juice"),
187
legend(2, 9, c("Ascorbic acid", "Orange juice"),
186
       fill = c("yellow", "orange"))
188
       fill = c("yellow", "orange"))
187
 
189
 
-
 
190
## With less effort (slightly different) using factor *interaction*:
-
 
191
boxplot(len ~ dose:supp, data = ToothGrowth,
-
 
192
        boxwex = 0.5, col = c("orange", "yellow"),
-
 
193
        main = "Guinea Pigs' Tooth Growth",
-
 
194
        xlab = "Vitamin C dose mg", ylab = "tooth length",
-
 
195
        sep = ":", lex.order = TRUE, ylim = c(0, 35), yaxs = "i")
-
 
196
 
188
## more examples in  help(bxp)
197
## more examples in  help(bxp)
189
}
198
}
190
\keyword{hplot}
199
\keyword{hplot}