added R code using ggplot2 for most of ch3.1-3.6