[R] perl advice
guido at hal.stat.unipd.it
Mon Dec 6 23:45:08 CET 1999
On Mon, Dec 06, 1999 at 05:12:44PM -0500, John D. Barnett wrote:
> Does anyone have a recommendation on how to call R from perl? I'm using
> the IPC::Open2 module, and running R with the --slave and --quiet
> options. The problem is that I can't predict how many lines of output I
> should try to read for each command-- if any!
> The ultimate goal is to use perl to provide a form-driven web interface,
> but have R do the underlying calculations.
A trick that I have used sometimes from tcl/tk is to redefine the
prompt to some funny string (sending to the controlled process
a 'option(prompt=...) command at the beginning) and then wait
for the prompt on the output. If I remember also ESS
works in a probably less weaker but similar approach (i.e., it
waits for a particular regular expression on the standard output
of the R process).
Hoping this can help,
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help