Added the R code that generates the images