Part2  of programming assignment in R-1