What is the simplest way to get results from R?

382 views Asked by At

lets say i have these files

normal.R

//plot normal distribution from userData
//save image to disk
//return json with filename

controller.php

$functionId = $_GET['functionId']
switch($functionId){
case 1:
//call normal.R with $_POST['userData'] as json
break;
}

ajax.js

$.post('/controller.php?functionId=1,{post:userData},function(data){
//set the src of an specific image to the returned one in the json
})

As you can see i need no interaction with R in the html in the way offered in rApache. I simply want to give json to R and get json from R. Exec scripts ist not supported by webhoster. I also looked into http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Web-Interfaces but it seems to much for my needs.

Can anybody offer a simple solution?

0

There are 0 answers