[R] R_BATCH_OPTIONS not respected?

Marius Hofert m@r|u@@ho|ert @end|ng |rom uw@ter|oo@c@
Tue Sep 10 13:37:22 CEST 2019


On Tue, Sep 10, 2019 at 12:38 PM Martin Maechler
<maechler using stat.math.ethz.ch> wrote:
>
> >>>>> Marius Hofert
> >>>>>     on Mon, 9 Sep 2019 22:38:38 +0200 writes:
>
>     > Hi,
>     > I typically start R with "--no-restore --no-save" (to avoid .RData
>     > files being written) and would like to have the same behavior under 'R
>     > CMD BATCH'. I use R_BATCH_OPTIONS="--no-restore --no-save" in my
>     > ~/.Renviron but running an R script with 'R CMD BATCH' still produces
>     > a .RData file. What's the correct way of getting the '--no-restore
>     > --no-save' options when in batch mode?
>
>     > (This is on macOS 10.14.6 with R version 3.6.1)
>
> Maybe macOS is the problem?
>
> It works fine on Linux:
>
> export R_BATCH_OPTIONS='--no-save --no-restore'
> R CMD BATCH <some>.R

Hoi Martin,

Thanks for helping. This also works for me, but not if I put
R_BATCH_OPTIONS="--no-restore --no-save" in ~/.Renviron.
If I have an R script called MWE.R containing
print(Sys.getenv("R_BATCH_OPTIONS")), I correctly see "--no-restore
--no-save"
being printed to .Rout, but still obtain .RData. (I also think this is
a macOS problem, but couldn't figure it out yet).

Cheers,
M

>
> produces  <some>.Rout and nothing else  for me
>
>
> Martin
>
>     > Thanks & cheers,
>     > M
>
>     > ______________________________________________
>     > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>     > https://stat.ethz.ch/mailman/listinfo/r-help
>     > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>     > and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list