Coursera R course assigment 2