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.