R script to produce scatterplots