update the R script