##### ##### ### Creating Figure 2, a dot plot of ### 2000 state education spending ##### ##### library(lattice) ##### ##### ### Requires data file: ### "spending, with names.txt" ##### ##### spending <- read.table(file.choose(), header = T) colnames(spending) spending$state <- reorder(spending$state, spending$educ.per.cap) dotplot(state ~ educ.per.cap, data = spending, aspect = 1.5, scales = list(cex = .6), xlim = c(-100, 2300), xlab = "State education spending, fiscal year 2000", panel = function (x, y) { panel.segments(rep(0, length(x)), as.numeric(y), x, as.numeric(y), lty = 2, col = "gray") panel.xyplot(x, as.numeric(y), pch = 16, col = "black")} )