added useful R snippets