Learn R Programming

qualityTools (version 1.31.1)

dotPlot: Function to create a dot plot

Description

dotPlot creates a dot plot. For data in groups the dotPlot is displayed stacked in one or not-stacked in different plot regions .

Usage

dotPlot(x, group, xlim, ylim, col, xlab, ylab, pch, cex, breaks, stacked = TRUE, ...)

Arguments

x
numeric values
group
grouping vector
xlim
limits of the x-axis
ylim
limits of the y-axis
col
colors for the different groups in the dot plot
xlab
a title for the x axis
ylab
a title for the y axis
pch
an integer specifying a symbol or a single character to be used for plotting points for the different groups in the dot plot
cex
the amount by which points and symbols should be magnified relative to the default
breaks
a vector giving the breakpoints for the binning of the values in x
stacked
stacked dot plot or not
...
further graphical parameters (see par)

Value

  • a matrix containing NA's and numeric values representing values in a bin. The number of bins is given by the number of columns of the matrix

Details

values in x are assigned to the bins defined by breaks. The actual binning is done using hist.

See Also

hist, boxplot

Examples

Run this code
#create some data and grouping
x = rnorm(28)
g = rep(1:2, 14)

#dot plot with groups and no stacking
dotPlot(x, group = g, stacked = FALSE, pch = c(19, 20), main = "Non stacked dot plot")

#dot plot with groups and stacking
x = rnorm(28)
dotPlot(x, group = g, stacked = TRUE, pch = c(19, 20), main = "Stacked dot plot")

Run the code above in your browser using DataLab