A web interface to an R program

user1331120 picture user1331120 · Apr 24, 2012 · Viewed 29.8k times · Source

I have to develop a web interface allowing the user to enter some inputs that will be passed to an Rscript as parameters and return the result to the user.

I have some questions for someone who have done a similar web interface:

  1. Which web framework to use
  2. What is the easiest way to communicate the web interface and the Rscripts (within the web app architecture)
  3. Should I install R on the server (if yes how to lauch the Rscripts from the web interface)

Answer

Spacedman picture Spacedman · Apr 24, 2012

R has its own web server, so you could do the whole thing within R. Then there's no need to bother with choosing a framework, or getting them to talk to each other and so on - just use an R framework:

http://cran.r-project.org/web/packages/Rook/index.html

If you don't like that for performance or other reasons, pretty much any framework will talk to R one way or another, so use what you are familiar with. I'd use Django and either call R via Rpy2 or run an Rserve process, but if you can program in PHP or Java then use a framework based on those languages. If you can't program in anything but R then either learn Python or use Rook.