R programming Coursera Assingment 2