Last data update: 2014.03.03

R: Dot Plots
DotplotR Documentation

Dot Plots

Description

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

Usage

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

Arguments

x

a numeric variable.

by

optinally a factor 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

if (require(car)){
  data(Duncan)
  with(Duncan, {
    Dotplot(education)
    Dotplot(education, bin=TRUE)
    Dotplot(education, by=type)
    Dotplot(education, by=type, bin=TRUE)
  })
}

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RcmdrMisc)
Loading required package: car
Loading required package: sandwich
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RcmdrMisc/Dotplot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Dotplot
> ### Title: Dot Plots
> ### Aliases: Dotplot
> ### Keywords: hplot
> 
> ### ** Examples
> 
> if (require(car)){
+   data(Duncan)
+   with(Duncan, {
+     Dotplot(education)
+     Dotplot(education, bin=TRUE)
+     Dotplot(education, by=type)
+     Dotplot(education, by=type, bin=TRUE)
+   })
+ }
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>