Dotplot: Dot Plots

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Dotplot.R

Description

Dot plot of numeric variable, either using raw values or binned, optionally classified by a factor. Dot plots are useful for visualizing the distribution of a numeric variable in a small data set.

Usage

1
2
Dotplot(x, by, bin = FALSE, breaks, xlim, 
    xlab = deparse(substitute(x)))

Arguments

x

a numeric variable.

by

optionally a factor (or character or logical variable) by which to classify x.

bin

if TRUE (the default is FALSE), the values of x are binned, as in a histogram, prior to plotting.

breaks

breaks for the bins, in a form acceptable to the hist function; the default is "Sturges".

xlim

optional 2-element numeric vector giving limits of the horizontal axis.

xlab

optional character string to label horizontal axis.

Details

If the by argument is specified, then one dot plot is produced for each level of by; these are arranged vertically and all use the same scale for x. An attempt is made to adjust the size of the dots to the space available without making them too big.

Value

Returns NULL invisibly.

Author(s)

John Fox jfox@mcmaster.ca

See Also

hist

Examples

1
2
3
4
5
6
7
8
9
if (require(car)){
  data(Duncan)
  with(Duncan, {
    Dotplot(education)
    Dotplot(education, bin=TRUE)
    Dotplot(education, by=type)
    Dotplot(education, by=type, bin=TRUE)
  })
}

Example output

Loading required package: car
Loading required package: carData
Loading required package: sandwich

RcmdrMisc documentation built on Aug. 13, 2020, 9:06 a.m.

Related to Dotplot in RcmdrMisc...