lattice (version 0.3-1)

dotplot: Dot Plots

Description

Draw Cleveland Dot plots

Usage

dotplot(formula,
        data = parent.frame(), 
        panel = panel.dotplot,
        ...)

Arguments

formula
a formula describing the form of conditioning plot. A formula of the form y ~ x | g1 * g2 * ... indicates that plots of y versus x should be produced conditional on the variable g1,g2,....
panel
panel function
data
data frame for variables in the call
...
other arguments

Value

  • An object of class ``trellis'', plotted by default by print.trellis.

synopsis

dotplot(formula, data = parent.frame(), panel = "panel.dotplot", prepanel = NULL, strip = TRUE, groups = NULL, ..., subset = TRUE)

Details

see the documentation for trellis.args as well as bwplot

See Also

trellis.args, panel.dotplot, Lattice

Examples

Run this code
data(VADeaths)
deathrate <- as.vector(VADeaths)
age <- rep(rownames(VADeaths), ncol(VADeaths))
type <- as.ordered(c(rep("Rural Male", 5),
          rep("Rural Female", 5),
          rep("Urban Male", 5),
          rep("Urban Female", 5)))
dotplot(age ~ deathrate | type, layout=c(1,4))
dotplot(type ~ deathrate | age, layout=c(1,5), ylab=NULL)
data(barley)
dotplot(variety~yield|year*site, data=barley)
dotplot(variety ~ yield | site, data = barley, groups = year,
        panel = function(x, y, subscripts, ...) {
            dot.line <- trellis.par.get("dot.line")
            panel.abline(h = y, col = dot.line$col,
                         lty = dot.line$lty)
            panel.superpose(x, y, subscripts, ...)
        },
        key = list(space="right", transparent = T,
                   points=list(pch=trellis.par.get("superpose.symbol")$pch[1:2],
                               col=trellis.par.get("superpose.symbol")$col[1:2]),
                   text=list(c("1932", "1931"))),
        xlab = "Barley Yield (bushels/acre) ",
        aspect=0.5, layout = c(1,6), ylab=NULL)

Run the code above in your browser using DataLab