Coursera course rprog-006 Programming Assignment 3