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