chazv copmletion of Programming Assignment 2 for coursera R programming course