Re: [R] scripts with littler

From: François Pinard <>
Date: Mon 08 Jan 2007 - 13:29:20 GMT

[John Lawrence Aspden]

>I'm trying to write R scripts using littler (under Debian), and was
>originally using the shebang line:

>#!/usr/bin/env r

>However this picks up any .RData file that happens to be lying around, which
>I find a little disturbing, because it means that the script may not behave
>the same way on successive invocations.

>If you drop the /usr/bin/env trick then

>#!/usr/bin/r --vanilla

>seems to work, but it also prevents the loading of the libraries in my home
>directory, some of which I'd like to use.

>#!/usr/bin/r --no-restore

>doesn't work at all.

>Ideally I'd like #!/usr/bin/env r --no-restore

>Has anyone else been round this loop and can offer advice?

I usually do something like:

R --slave --vanilla <<EOF

   R script goes here...

EOF # vim: ft=r

If you need to search special places for packages, you may tweak exported environment variables between the first and second line.

François Pinard

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Jan 11 04:04:36 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 10 Jan 2007 - 17:30:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.