[R] Accessing R applications from Web

John McNeil jam at xardas.com
Thu Apr 19 17:42:00 CEST 2007


Sarthi,

I have done what you describe using PHP and R on a linux server.  
Basically, you follow these steps:
- Create a form to gather input
- Parse input from the form with PHP into a file that R can read
- Run R commands from PHP with exec().
- Convert the postscript output to an image a web browser can read,
- Use HTML/PHP to format the output with a link to the image

I learned to do this by studying Alfredo Pontillo and Angelo Mineo's  
R-php (http://dssm.unipa.it/R-php). Specifically, look at the file  
pages/result/index.php  They have done lots of other good stuff in  
their project, like filtering dangerous commands - you would not want  
to let a user just type in any R code, because they could seriously  
damage your server. However, if you keep the R code on the server,  
and just parse numeric or string inputs, you can take the simple  
approach described above.

You will need to install GhostScript (http://www.gnu.org/software/ 
ghostscript/ghostscript.html) and ImageMagick (http:// 
www.imagemagick.org/) on your server for the image conversion

Feel free to email me directly if you have problems

John
http://www.labsynch.com

On Apr 19, 2007, at 2:46 AM, d. sarthi maheshwari wrote:

> Hi
>
> I am trying to provide web interface to my R application. My  
> requirements
> are simple and can be written down as follows :
>
> 1) User must provide all the input parameters on web interface.
> 2) Based on the input values, R will do some computations.
> 3) Project the numerical results as well as plots as html page to  
> the user
> on web.
>
> Kindly tell me which package can help me in doing this. Your help  
> would be
> highly appreciated.
>
> -- 
> Thanks & Regards
> Sarthi M.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting- 
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list