R programs for Coursera course