snippets of R code