added R code from 11/13 class