Miscellaneous functions I've written for R, mostly related to data processing