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:

  • Download and Install R
  • Install the Rserve package #you install this like other R packages.
  • Install the Rserve-Ruby Client
  • 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:

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


    To answer your questions:

  • 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.

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

  • 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.

  • 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.

  • 链接地址: http://www.djcxy.com/p/10590.html

    上一篇: Java获取边框颜色和大小

    下一篇: 将Rserve集成到Rails应用程序中