Hi all,
Is there any documentation on running R like one would run a shell or
Perl script, with out/input directed appropriately, environment variable
access, and command switch processing?
I looked some, and even remembered to check the FAQ, but couldn't find
anything.
Thanks
W
Someone had modified the R source to handle this, but it has not been
incorporated into the official R source, if I'm not mistaken. Search the
R-devel archive.
HTH,
Andy
From: Webb Sprague
Hi all,
Is there any documentation on running R like one would run a shell or
Perl script, with
Liaw, Andy [EMAIL PROTECTED] writes:
Someone had modified the R source to handle this, but it has not been
incorporated into the official R source, if I'm not mistaken. Search the
R-devel archive.
You can do stuff like this though:
cat test.R
#!/bin/sh
tail +3 $0 | R --vanilla --args $@ ;
That someone might have been me; I did at one time figure out how to
execute scripts based on a first line like that of the subject line
of this thread.
As I recall, what I did was
1) before attempting to execute a script having such a first line,
define the env vars that R.bin needs
2)
Hi
Associated with that attempt was a modification of the sources that I
made, commenting out two lines in system.c, specifically:
See file ./source/src/unix/system.c
line 239 in R-1.8.1 patched as of 12/3/03
snprintf(msg, 1024, ARGUMENT '%s' __ignored__\n, *av);
You may be interested in this thread from R-devel last October:
https://www.stat.math.ethz.ch/pipermail/r-devel/2003-October/027862.html
If I recall correctly, Duncan Temple Lang is working on different
ways to initialize R but I'm not sure what the status of that is.
-roger
Webb Sprague
Webb Sprague wwsprague at ucdavis.edu writes:
: Is there any documentation on running R like one would run a shell or
: Perl script, with out/input directed appropriately, environment variable
: access, and command switch processing?
:
: I looked some, and even remembered to check the FAQ, but