add R code for plots 1 to 4 as well as png files