R code from SCU DS classes