programming assignment 2 in coursera R programming class.