R code

Code to generate the requested graphs