A lot of different R functions I wrote