[R] Command line R / PHP? - Thanks

Zitan Broth zitan at mediasculpt.net
Tue Sep 16 01:03:48 CEST 2003


Greetings All,

I just wanted to say, somewhat belatedly, a huge thank you to all those who
answered my question.  I hope I have got all of you::

Thanks to Ruud, Jonathan, James, Martin, Andrew and Dennis.

Basically the solution and noted by these helpful people is to use infile
thereby creating an infile with php (using simple file io) calling R from
the command line with infile and writing the results to and output file
which can then be opened by PHP later.

The batch file call would be something like (from Ruud)::
     path_to_R\bin\Rterm.exe --no-restore --no-save < %1 > %1.out 2>&1

And away I go.

Again thank you all :-)

Z.


----- Original Message -----

> Greetings All,
>
> Just a quick query about calling R.  Looking through the manual you start
R
> with $ R, and then start calling R functions e.g plot whatever.  Sounds
> pretty funky, and R looks to be *the* open source maths package.  Awesome
> ...  I would like to call R from my favourite glue language PHP (rather
than
> call perl which calls R) if possible.  To call R from the command line is
> all this would require and this also seems quite possible ::
>
>     Batch use: At its simplest, Rterm.exe can be used in a batch mode by
> commands like
>         Rterm.exe --no-restore --no-save < infile > outfile
>
> And there is more information on this in section B.1 Invoking R under UNIX
> cool.
>
> However what I can't find is how to specify what function I want to run on
> my infile, say calculate standard deviation or means or linear regression
> and getting probabilities translations for t-statistics.  Have I missed
this
> in the docs?
>
> Any suggestions are greatly appreciated.   Awesome and a big thanks.
>
> Z.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>




More information about the R-help mailing list