Programming Assignment 3 for R Programming Course in coursera