R code for Data Science Coursera