Coursera R programming assignment