Various R code snippets to help move things forward