With this feature, web developers that use Php as their main language and need calculations done by R will easly use this library.
It is distributed as its big brother, RCaller Java Edition, with the LGPL (Lesser GNU Public License).
RCallerPhp is intended to be compatible as much as possible with the Java version. So, investigating the old examples may be helpful for understanding this new release.
In a time of less than a week, we released this version without the plotting support. By now, generating R plots and showing them in a browser is implemented. Generated plots are stored in the temp directory instead www directory. That is why we are encoding generated plots inside the img src tags with base64 encoding. You can have a look at the source code at RCaller source code at Google project hosting.
Handling plots with RCallerPhp is quite easy. Let's have a look at the code below:
<?php require_once("../RCode.php"); require_once("../RCaller.php"); require_once("simpletest.php"); $caller = new RCaller(); $code = new RCode(""); $plot = $code->startPlot(); $code->addRCode("plot.ts(rnorm(10))"); $code->endPlot(); $caller->setRscriptExecutable("/usr/bin/Rscript"); $caller->setRCode($code); $caller->runOnly(); print($caller->getPlot($plot)); ?>
Here is the generated output, which is copied from the web browser:
Nothing is easier than this! Do not hasitate to ask anything about RCaller.
We hope you enjoy...
Have fun...
I dont know if you will read this ... but I would like to know in the php code above what is ... "simpletest.php" since it is not included in the zip file .... second can usend me the R script u used since i would like to confirm ... my results with you ... thank you
ReplyDelete