Updated the R scripts