R code samples