Re: [R] how to call R in PHP
Hi, rapache.net is definitely worth to check. And also rook from the same author (Jeffrey Horner). Best, Gergely On 28 March 2013 03:19, Lauren Zhang zxj19880...@yahoo.cn wrote: Hi, I met tough problems when calling R in PHP. I have tried several ways, but none of them succeed. first of all, I tried Rserve, but I failed to connect to it. Then, I tried cmd.exe. I get the result when I use R CMD BATCH --vanilla... in cmd, but I have no idea how to call cmd in php. I know system() is good to call other systems, I triedbut I get no result in my html page. if you could provide some suggestion or examples, i would appreciate your help. the code in my php is£º $cmd=R CMD BATCH--vanilla --slave delete.r; $res=system($cmd); the code in the delete.r file is: setwd(c://wamp//www//analysis); x-4; y-3; z-x*y; sink(125.txt); png(file=125.png); barplot(z,border=dark blue) title(main=list(earning of comparison,font=4)); plot(x,z); dev.off() [[alternative HTML version deleted]] __ R-help@r-project.org 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. [[alternative HTML version deleted]] __ R-help@r-project.org 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.
[R] how to call R in PHP
Hi, I met tough problems when calling R in PHP. I have tried several ways, but none of them succeed. first of all, I tried Rserve, but I failed to connect to it. Then, I tried cmd.exe. I get the result when I use R CMD BATCH --vanilla... in cmd, but I have no idea how to call cmd in php. I know system() is good to call other systems, I triedbut I get no result in my html page. if you could provide some suggestion or examples, i would appreciate your help. the code in my php isï¼ $cmd=R CMD BATCH--vanilla --slave delete.r; $res=system($cmd); the code in the delete.r file is: setwd(c://wamp//www//analysis); x-4; y-3; z-x*y; sink(125.txt); png(file=125.png); barplot(z,border=dark blue) title(main=list(earning of comparison,font=4)); plot(x,z); dev.off() [[alternative HTML version deleted]] __ R-help@r-project.org 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.
Re: [R] how to call R in PHP
While someone around here might know about PHP (I don't h, the fact that you don't know how to call system suggests that you should be asking in a PHP help forum. Rserve can be used for interactive sessions, but web services usually aren't designed that way, so you probably want to call R with batch arguments the same way you would call it from the command interpreter, but not actually via the command interpreter. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Lauren Zhang zxj19880...@yahoo.cn wrote: Hi, I met tough problems when calling R in PHP. I have tried several ways, but none of them succeed.�� first of all, I tried Rserve, but I failed to connect to it. Then, I tried cmd.exe. I get the result when I use��R CMD BATCH --vanilla... in cmd, but I have no idea how to call cmd in php. I know system() is good to call other systems, I triedbut I get no result in my html page. if you could provide some suggestion or examples, i would appreciate your help. the code in my php is��� $cmd=R CMD BATCH--vanilla --slave delete.r; $res=system($cmd); the code in the delete.r file is: setwd(c://wamp//www//analysis); x-4; y-3; z-x*y; sink(125.txt); png(file=125.png); barplot(z,border=dark blue) title(main=list(earning of comparison,font=4)); plot(x,z); dev.off() [[alternative HTML version deleted]] __ R-help@r-project.org 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. __ R-help@r-project.org 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.