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

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

Arguments

x

vector with numeric values which should be plotted.

group

(optional) vector for grouping the values (see examples).

xlim

vector giving the lower and upper limit of the x-axis.

ylim

vector giving the lower and upper limit of the y-axis.

col

vector containing numeric values or strings for different colors for the groups in the dot plot.

xlab

a title for the x axis: title.

ylab

a title for the y axis: title.

pch

a vector of integers specifying symbols 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

a logical vector specifying whether the single groups should be plotted in a stacked dot plot or in a single one. By default stacked is set to ‘TRUE’.

...

further graphical parameters (see par)

.

Details

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

Value

dotPlot a invisible 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.

Author(s)

Thomas Roth thomas.roth@tu-berlin.de

See Also

hist
boxplot
http://www.r-qualitytools.org/html/Analyze.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#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")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.