Coursera R assignment