R code for Data Science course