Completed R file for the Programming Assignment 2 in R Programming (Coursera)