R example snippets