This is the work of Programming Assignment 2 from Coursera R Programming course.