R Code for the exercises in introduction to Statistical Learning 4th ed