Hello- 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. Thanks for any help! -John Barnett -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, Dec 06, 1999 at 05:12:44PM -0500, John D. Barnett wrote:> Hello- > > 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, guido -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 6 Dec 1999, 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. >Before you reinvent the wheel, look at Jeff Banfield's Rweb: http://www.math.montana.edu/Rweb/ You might contact him directly: jeff at math.montana.edu (I know he doesn't read R-help.) if you have more questions. Jim Jim Robison-Cox ____________ Department of Math Sciences | | phone: (406)994-5340 2-214 Wilson Hall \ BZN, MT | FAX: (406)994-1789 Montana State University | *_______| Bozeman, MT 59717-2400 \_| e-mail: jimrc at math.montana.edu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._