R code used to produce the results in this study