add r support

as title, the syntax is a little bit complicated because of [this](http://rpubs.com/gallery/options).