R programming assignment for Coursera R course