Learn R Programming

broman (version 0.84)

dotplot: Dot chart with a gray background

Description

Like the grayplot() function, but with one axis assumed to be categorical.

Usage

dotplot(group, y, jiggle = NULL, max_jiggle = 0.45, rotate = FALSE, ...)

Value

None.

Arguments

group

Categorical coordinates for the plot

y

Coordinates of points in the plot

jiggle

Vector of amounts to jiggle the points horizontally, or a character string ("fixed" or "random") indicating the jiggling method; see jiggle().

max_jiggle

Maximum jiggle value; passed to jiggle() as argument maxvalue.

rotate

If TRUE, have group as y-axis; default (FALSE) has group on x-axis.

...

Optional graphics arguments

Details

Calls grayplot() with special choices of graphics parameters for the case of categorical x.

If group is a factor, the order of the groups is as in the levels. Otherwise, we take sort(unique(group)). So if you want to control the order of the levels, make group a factor with the levels in the desired order, for example group <- factor(group, levels=unique(group)).

See Also

grayplot(), timeplot()

Examples

Run this code
set.seed(97536917)
x <- rnorm(40, c(1,3))
g <- rep(c("A", "B"), 20)
dotplot(g, x)
dotplot(g, x, "fixed")
dotplot(g, x, runif(length(g), -0.25, 0.25))

Run the code above in your browser using DataLab