Question

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)
Was it helpful?

Solution

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.

OTHER TIPS

Rstudio has a new server called Shiny which uses node.js for the UI:

https://github.com/rstudio/shiny-server

Rstudio provides a webinterface for R see http://rstudio.org/docs/server/getting_started

A very convenient way is to combine Rstudio Server and Rook (see the other answers for the links).

Rstudio Server provides a very easy way to setup an R server that can be accessed by anyone inside the network. You'll typically use it to edit and run your script on that server.

Rook allows you to easily create a web interface by mixing html code for text and interaction (like input fields, etc.) and R code. Once your script works, just launch it from within Rstudio Server, and any user (with access) will be able to connect to it, on the same IP as Rstudio Server.

I am using this setup together with googleVis and am very satisfied.

OpenCPU is currently, in my opinion, the most advanced free package for creating stateless (REST) web services in R. Shiny is a great framework, but if you plan to use the free community version, note that it doesn't handle concurrent calls.

There's a good list on the R website - http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Web-Interfaces

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top