Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically create R graphics for webpage

I've spent a few weeks learning some R and I'm floored at just how slick and powerful it is. I'm using it to plot some data returned from an SQL query, and I'd like to be able to share those plots with others I work with through a web portal.

I realize I can create a cron job to run the R scripts on the webserver to create the plots daily to be viewed from the website as images. But is there any way I can set things up such that the images are created only when the user views the page? That way I could make a web interface that lets the user select date ranges, etc for the SQL query. (and then have R analyse the data and plot it)

Any advice?

like image 951
user246211 Avatar asked Jan 11 '10 03:01

user246211


3 Answers

I don't do a lot of dynamic html stuff with R but you could start with either one of these

  • rapache: R inside Apache
  • Rpad: Web-based R
  • R FAQ on Web interfaces

Also of interest may be brew for mixing R text and R code in web templates.

like image 144
Dirk Eddelbuettel Avatar answered Nov 20 '22 19:11

Dirk Eddelbuettel


I like to call R to do statistical analysis from Python driven websites with rpy2.

like image 22
Mark Avatar answered Nov 20 '22 17:11

Mark


Beyond the other suggestions, you can use JRI and call R from Java.

Another nice option is to use the mediawiki plugin (read about it on the R-Wiki). It's very straightforward and gives you a simple markup for R.

like image 1
Shane Avatar answered Nov 20 '22 18:11

Shane