Revised plot 1 R code