Programming assignment 2 for R -coursera with comments