Integrating Rserve Into A Rails Application
Asked Answered
R

1

7

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.

Rill answered 2/4, 2012 at 0:5 Comment(4)
I've not gone the route you are looking into but would think this would offer easier integration: opencpu.orgFeleciafeledy
Hansi - So open CPU has a rest API to accomplish the integration.Rill
Yes and query caching built in.Feleciafeledy
Just to share my experience I integrated R with system calls and it worked quite nicely. I used paperclip and in the before save filters dynamically created images based on data.Senegambia
D
3

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.

Dahabeah answered 24/10, 2013 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.