Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A web interface to an R program [closed]

Tags:

r

web

rscript

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)
like image 882
user1331120 Avatar asked Apr 24 '12 08:04

user1331120


People also ask

Can R be run on browser?

It should be noted that opening a browser from R will do exactly just that; it will not provide a way for R to communicate or control it. Users looking to use R for webscraping should consider using the RSelenium package, as it provides a number of functions to navigate and interact with web pages.

What does the R console teach you about programming in the R interface?

If R is ready to accept commands, the R console shows a > prompt. If it receives a command (by typing, copy-pasting or sent from the script editor using Ctrl + Return ), R will try to execute it, and when ready, show the results and come back with a new > -prompt to wait for new commands.

What is R interface?

R is a dialect of the S language. It is a case-sensitive, interpreted language. You can enter commands one at a time at the command prompt (>) or run a set of commands from a source file.

Can you run an R script without R?

▶ You can run an R file without explicitly opening R.


2 Answers

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.

like image 143
Spacedman Avatar answered Nov 15 '22 18:11

Spacedman


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

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

like image 20
Hari Titan Avatar answered Nov 15 '22 17:11

Hari Titan