I've hacked R so that it can be used to write shell and/or CGI scripts, e.g. "hello world" can be written as: #!/usr/local/lib/R/bin/R.bin --script cat("Hello, World!\n"); The mods required to enable this aren't particularly major. (Adds about 70 lines of code, IIRC.) Anyone else interested in adding this to the R core? -- Neil D. McKay, Mail Code 480-106-359 Phone: (586)986-1470 (GM:8-226-1470) Enterprise Systems Lab FAX: (586)986-0574 (GM:8-226-0574) GM Research & Development Center Internet: mckay@gmr.com 30500 Mound Road Warren, Mich. 48090 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> I've hacked R so that it can be used to write shell and/or > CGI scripts, e.g. "hello world" can be written as: > > > #!/usr/local/lib/R/bin/R.bin --script > > cat("Hello, World!\n"); > > The mods required to enable this aren't particularly major. > (Adds about 70 lines of code, IIRC.) Anyone else interested > in adding this to the R core?Yes! I found it very useful in other software systems (e.g. Octave). That feature-request gets discussed here every now and then; I recall Peter and Luke discussing it here a few months back. Dirk -- According to the latest figures, 43% of all signatures are totally worthless. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Yes. Can you send me a copy of the patch? Thanks, Greg> -----Original Message----- > From: Neil McKay MD [mailto:jz0vs8@gmr.com] > Sent: Thursday, April 11, 2002 10:40 AM > To: r-devel@stat.math.ethz.ch > Subject: [Rd] Mods that allow R scripts > > > I've hacked R so that it can be used to write shell and/or > CGI scripts, e.g. "hello world" can be written as: > > > #!/usr/local/lib/R/bin/R.bin --script > > cat("Hello, World!\n"); > > The mods required to enable this aren't particularly major. > (Adds about 70 lines of code, IIRC.) Anyone else interested > in adding this to the R core? > > -- > Neil D. McKay, Mail Code 480-106-359 Phone: (586)986-1470 > (GM:8-226-1470) > Enterprise Systems Lab FAX: (586)986-0574 > (GM:8-226-0574) > GM Research & Development Center Internet: mckay@gmr.com > 30500 Mound Road > Warren, Mich. 48090 > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-devel 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-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Neil McKay MD writes:> I've hacked R so that it can be used to write shell and/or > CGI scripts, e.g. "hello world" can be written as: > #!/usr/local/lib/R/bin/R.bin --script > cat("Hello, World!\n");That is very cool, and would replace about 25 lines of Perl wrapper for me, IF you could also easily pass flags and arguments, e.g.: Unix> myRscript -e -f datafile These would have to become R variables, somehow. -- -- David Brahm (brahm@alum.mit.edu) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._