# Three graphics systems #----------------------- library(faraway) # From package "graphics" (default) qqnorm(nels88$math) qqline(nels88$math) hist(nels88$math) # From package "ggplot2" library(ggplot2) qplot(sample=math, data=nels88, facets=~race) qplot(sample=math, data=nels88, color=race) qplot(math, data=nels88, binwidth=5) # From package "lattice" library(lattice) qqmath(~math, data=nels88) qqmath(~math, data=nels88, prepanel = prepanel.qqmathline, panel = function(x) { panel.qqmath(x) panel.qqmathline(x) }) qqmath(~math | race, data=nels88) qqmath(~math | race, data=nels88, prepanel = prepanel.qqmathline, panel = function(x) { panel.qqmath(x) panel.qqmathline(x) }) histogram(~math, data=nels88) # A modified version from package "car" library(car) qqPlot(nels88$math)