Pieces of R code that I wrote