add R code and pictures