Miscellaneous work I'm doing in R