The R script