replace R script file