RSRuby 0.5

RSRuby is a bridge between Ruby and the R interpreted language.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
GPL (GNU General Public License) 
3.4/5 17
Alex Gutteridge
ROOT \ Programming \ Interpreters
RSRuby is a bridge between Ruby and the R interpreted language. When RSRuby is called in a Ruby script, a full R interpreter is embedded into the Ruby interpreter, allowing the Ruby script to call functions from any R library the user wishes.

Most data conversion is handled automatically, but user-definable conversion routines can also be written to handle any R or Ruby class.

RSRuby is a partial conversion of RPy, and shares the same goals of robustness, ease of use and speed. The current version is stable and passes 90% of the RPy test suite. Some conversion and method calling semantics differ between RPy and RSRuby (largely due to the differences between Python and Ruby), but they are now largely similar in functonality.

Major things to be done in the future include proper handling of OS signals, user definable I/O functions, improved DataFrame support and inevitable bug fixes.


R programming language


A working R installation is required. R must have been built with the '-enable-R-shlib' option enabled to provide the R shared library used by RSRuby.

Ensure the R_HOME environment variable is set appropriately. E.g.:

R_HOME=/usr/lib/R (on Ubuntu Linux)
R_HOME=/Library/Frameworks/R.framework/Resources (on OS X)

An RSRuby gem is available as well as a package using setup.rb. In each case the installation requires the location of your R library to compile the extension. This is usually the same as R_HOME. If you download the setup.rb package use these incantations:

ruby setup.rb config -- --with-R-dir=$R_HOME
ruby setup.rb setup
ruby setup.rb install

Using gems it is almost the same:

gem install rsruby -- --with-R-dir=$R_HOME

If RSRuby does not compile correctly you may need to configure the path to the R library, any one of the following should be sufficient:

Put the following line in your .bashrc (or equivalent):


or, make a link to RHOME/bin/ in /usr/local/lib or /usr/lib, then run 'ldconfig'.

or, edit the file /etc/, add the following line and then run 'ldconfig':


What's New in This Release:

Fixes a few bugs.
Also adds an RSRuby.img() method to make plotting to files a little more convenient.
No need to remember all the time.

Last updated on April 28th, 2008

#data convertor #ruby module #R interpreter #R interpreter #Ruby #module #library

Add your review!