R code for my presentation at R User Group Singapore