Programming assignment 2 for R Programming by R. Peng in COURSERA