R code for Statistical Learning