There are several options, but one of them is using RApache. Install RApache as directed at http://rapache.net/manual.html
Set the Apache directive in httpd.conf, which will check all the files in the / var / www / brew directory as R scripts
<Directory /var/www/brew>
SetHandler r-script
RHandler brew::brew
</Directory>
R script API plot.R /var/www/ brew. R script , , :
<%
library(rjson)
args <- GET
tmp <- lapply(args, FUN=function(x) strsplit(x, " "))
typeOfData <- tmp[[1]][1]
month <- tmp[[2]][1]
year <- tmp[[3]][1]
output <- list(imgname="imgs/tmax.tiff")
cat(toJSON(output))
%>
GET
API PHP, -, http://localhost/brew/plot.R?typeOfData=1&month=2&year=2014. localhost IP- , API.
RApache , GET, POST, COOKIES, FILES, SERVER, API. , POST GET, . . http://rapache.net/manual.html .
, : API, R?