R example

* add example R code
* closes #433