Calling R from php
1
0
Entering edit mode
Fahim Md ▴ 250
@fahim-md-4018
Last seen 9.7 years ago
Hi I am trying to give user interface to my tool and willing to call R from php. I am able to install, configure and run the example given on rapache manual website http://rapache.net/manual.html and I suppose it is working perfect. I have a couple of varibles in php (such as input file path and other variables) that I want to send to R. The manual mentions how to call an R file but I could not figure out how to pass arguments from php (post variables) to an R file or R functions. # test.php file #R file to be called (Filename: test.R): Function name is foo. foo ( $var1, $var2, $geneArray, $inpFile) ) // How to receive the variable. #http.conf file. //What to modify in this file ServerName localhost LoadModule R_module /usr/lib/apache2/modules/mod_R.so ROutputErrors <location rapachetest=""> SetHandler r-handler RFileHandler /home/fahim/webRugit/hello.R </location> Do I need to modify any other file??? Thanks a lot. Fahim [[alternative HTML version deleted]]
• 2.3k views
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 2 hours ago
Seattle, WA, United States
Hi Fahim, This question is probably too general for this list. Remember that this is the Bioconductor mailing list ;-) You might want to ask to the rApache people directly or maybe try the R-help mailing list instead. Good luck, H. On 11-06-07 10:50 AM, Fahim Mohammad wrote: > Hi > I am trying to give user interface to my tool and willing to call R from > php. I am able to install, configure and run the example given on > rapache manual website http://rapache.net/manual.html and I suppose it is > working perfect. > > I have a couple of varibles in php (such as input file path and other > variables) that I want to send to R. The manual mentions how to call an R > file but I could not figure out how to pass arguments from php (post > variables) to an R file or R functions. > > > # test.php file > $var1 = "cat"; > $var2 = "dog"; > $geneArray = ""; > $inpFile = "/home/fahim/webRugit/dataFile.php"; > $processComplete = 0; > > > $processComplete = howToCall($var1, $var2, $geneArray, $inpFile); // How to > communicate? How to invoke the R > ?> > > #R file to be called (Filename: test.R): Function name is foo. > foo ( $var1, $var2, $geneArray, $inpFile) ) // How to receive the variable. > > #http.conf file. //What to modify in this file > ServerName localhost > LoadModule R_module /usr/lib/apache2/modules/mod_R.so > ROutputErrors > <location rapachetest=""> > SetHandler r-handler > RFileHandler /home/fahim/webRugit/hello.R > </location> > > Do I need to modify any other file??? > > Thanks a lot. > Fahim > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
ADD COMMENT

Login before adding your answer.

Traffic: 812 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6