Added some of the R code used in the analysis