Coursera R Programming assignment