R_BATCH_OPTIONS not respected?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

R_BATCH_OPTIONS not respected?

Marius Hofert-4
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)

Thanks & cheers,
M

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R_BATCH_OPTIONS not respected?

Martin Maechler
>>>>> 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

produces  <some>.Rout and nothing else  for me


Martin

    > Thanks & cheers,
    > M

    > ______________________________________________
    > [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: R_BATCH_OPTIONS not respected?

Marius Hofert-4
In reply to this post by Marius Hofert-4
On Tue, Sep 10, 2019 at 12:38 PM Martin Maechler
<[hidden email]> 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
>
>     > ______________________________________________
>     > [hidden email] 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.

______________________________________________
[hidden email] 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.