Working version of the code and the final plot

Lots of changes in the interim. Final version uses ggplot2 for plotting
and dplyr for data wrangling. I need to learn more about ggplot if I am
go to continue using it. Could not created the exact image I wanted :-(