add cleaned-up snippets for R

pushing cleaned up snippets based on SirVers comments regarding first PR#377. All snippets are tested and work just as you would them expect to. Thanks for the hints, much cleaner now!