Programming assignment 2 for the R-programming course on Coursera