Adding R code to generate plot graphics