R code for various projects