figures and R code