coursera R-Programming assignment2