R shell integration.
Hi Neil. I was just thinking about this in the last few days. It might well be nice to have this and encourage people to think of R as a regular scripting language as well as an interactive session language. (We also would want to try to streamline the startup time which is gradually becoming possible.) If you send me what you currently have for 1.5.0, I'd be happy to see if we might include them in R or find a way to provide them as an optional add-on. Or if you want to update them for 1.6.1, that would be great too and save me the trouble. D.
Neil McKay MD wrote:
Barry Rowlinson writes:
Wouldn't it be nice to be able to do this:
./analyse.R -gamma=2 <data.in >data.out
where analyse.R looks like this:
#!/usr/bin/R
gamma <- getopt("gamma")
mydata <- scan(...)
etc? In other words, be able to write executable R scripts?
I have a patch for R that does exactly this. (Latest version's
for R 1.5.0; haven't upgraded to 1.6 yet.) It turns out that it
only requires a few minor changes to R, plus an additional 100-some
lines of code. It allows me to write things like:
#!/usr/local/lib/R/bin/R.bin --script
cat("Hello world!\n")
If anyone's interested in the patches, I'll upgrade them to R 1.6
(which I should do anyway) and give them to you. It would be nice
to have these patches pre-applied to the R sources so I don't have
to maintain them myself. (Hint, hint.)
--
Neil D. McKay, Mail Code 480-106-359 Phone: (586)986-1470 (GM:8-226-1470)
Manufacturing Systems Research Lab FAX: (586)986-0574 (GM:8-226-0574)
GM Research & Development Center Internet e-mail: 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_______________________________________________________________
Duncan Temple Lang duncan@research.bell-labs.com
Bell Labs, Lucent Technologies office: (908)582-3217
700 Mountain Avenue, Room 2C-259 fax: (908)582-3340
Murray Hill, NJ 07974-2070
http://cm.bell-labs.com/stat/duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._