R code for various projects at work