R code for various things.