Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Rserve Into A Rails Application

This question is a follow-up to a question I posted earlier this year.

Integrating R Statistical Package into Rails Application

Based upon the response I received, I have landed on Rserve as the means to integrate R into my rails application. Specifically, I will:

  1. Download and Install R
  2. Install the Rserve package #you install this like other R packages.
  3. Install the Rserve-Ruby Client
  4. Install rserver-simpler #this gems is a simpler interface to the Rserve-Ruby client.

I'm running jruby via torque box and plan to use R with the mlogit package.

My questions are:

  1. Has anyone followed a similar approach and what has been your experience. What are the gotchas
  2. How is the performance. Rserve_Ruby Client is supposed to be performant.
  3. What R packages have you used? Have you used the mlogit package.
  4. Please share any additional information you think may be helpful.

Thanks for your input.

like image 875
Mutuelinvestor Avatar asked Apr 02 '12 00:04

Mutuelinvestor


1 Answers

To answer your questions:

  1. Yes. I integrated rserve into a rails application. I served it successfully on my own server. I did have some issues when trying to use Heroku to serve my app (using the r buildpack). While debugging I switched to rinruby to match the examples for the buildpack.

  2. The performance of rserve was good on my server. Rinruby also performs well.

  3. I do not use any packages in my app. However it is easy to do so. If you are deploying to Heroku, see the init.r file in the example for the r buildpack.

  4. For an app with little traffic, Heroku will serve the app for free. The main difference between rserve and rinruby is that with rserve you will start up your own instance of R that ruby will then communicate with. Rinruby starts its own instance of R from within ruby.

like image 185
Christopher Louden Avatar answered Sep 29 '22 02:09

Christopher Louden