R functions and bits of code that I reuse