R code used to complete Coursera, Exploratory Data Analysis, course assignment 2