Re: [R] writing R shell scripts?

From: FWS <frank.samuelson_at_fda.hhs.gov>
Date: Wed 08 Feb 2006 - 03:44:56 EST

Use the all powerful "here document" feature of bash:

R --vanilla << "EOF" # Pipe all subsequent lines into R. ####### Here's my R code

require(tcltk)
tkmessageBox(message="It works")

###### the end
EOF Mike Miller wrote:
> I'm new to the list. I've used R and S-PLUS a bit for about 15 years but
> am now working to make R my main program for all numerical and statistical
> computing. I also use Octave for this kind of work and I recommend it (it
> is also under the GPL). Here's my question: In Octave I can write shell
> scripts in the Linux/UNIX environment that begin with a line like this...
>
> #!/usr/local/bin/octave -q
>
> ...and the remaining lines are octave commands. Is it possible to do this
> sort of thing in R using something like this?:
>
> #!/usr/lib/R/bin/R.bin
>
> Well, that isn't quite it because I tried it and it didn't work!
>
> Any advice greatly appreciated. Thanks in advance.
>
> Mike
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Feb 08 05:47:40 2006

This archive was generated by hypermail 2.1.8 : Wed 08 Feb 2006 - 23:29:37 EST