adding R code