Exercise for R programming on Coursera