stripchart
produces one dimensional scatter plots (or dot
plots) of the given data. These plots are a good alternative to
boxplot
s when sample sizes are small.stripchart(x, ...)## S3 method for class 'formula':
stripchart(x, data = NULL, dlab = NULL, \dots,
subset, na.action = NULL)
## S3 method for class 'default':
stripchart(x, method = "overplot", jitter = 0.1, offset = 1/3,
vertical = FALSE, group.names, add = FALSE,
at = NULL, xlim = NULL, ylim = NULL,
ylab = NULL, xlab = NULL, dlab = "", glab = "",
log = "", pch = 0, col = par("fg"), cex = par("cex"),
axes = TRUE, frame.plot = axes, ...)
formula
method, a symbolic
specification of the form y ~ g
can be given,
indicating the observations in the vector y
are to be
grouped according to the levels of the factor
g
. NA
s are allowed in the data.x
should be taken.NA
s. The default is to ignore missing
values in either the response or the group.plot.window
, points
,
axis
and title
to control the appearance
of the plot."overplot"
causes such points to be
overplotted, but it is also possible to specify "jitter"
to
jitter the points, or "stack"
have coincident points
stacked. The last method only makes sense for very granular data.method = "jitter"
is used, jitter
gives the amount of jittering applied.TRUE
the plots are drawn
vertically rather than the default horizontal.add = TRUE
;
defaults to 1:n
where n
is the number of boxes.title
.plot.window
.plot.default
par
.plot.default
. The dlab
and glab
labels may be used instead of xlab
and ylab
if those are not specified. dlab
applies to the
continuous data axis (the X axis unless vertical
is TRUE
),
glab
to the group axis.
x <- stats::rnorm(50)
xr <- round(x, 1)
stripchart(x) ; m <- mean(par("usr")[1:2])
text(m, 1.04, "stripchart(x, "overplot")")
stripchart(xr, method = "stack", add = TRUE, at = 1.2)
text(m, 1.35, "stripchart(round(x,1), "stack")")
stripchart(xr, method = "jitter", add = TRUE, at = 0.7)
text(m, 0.85, "stripchart(round(x,1), "jitter")")
stripchart(decrease ~ treatment,
main = "stripchart(OrchardSprays)",
vertical = TRUE, log = "y", data = OrchardSprays)
stripchart(decrease ~ treatment, at = c(1:8)^2,
main = "stripchart(OrchardSprays)",
vertical = TRUE, log = "y", data = OrchardSprays)
Run the code above in your browser using DataLab