Added an R script which does the same thing as example.py, to use as a benchmark