Assignment number 2 for the coursera R programming