Some snippets for doing stuff in R