R script to produce plot 2