R code and demos and relevant