Programming Assignment 2 of R-programming course, Coursera.