A collection of useful R code