final R script and README