Update the R code