The solution to this question is to set environmental variable R_ENVIRON
that point to the .Renviron file. I should read the ?Startup more carefully.
Best,
Jinsong
On 2020/8/31 3:45, Henrik Bengtsson wrote:
Sorry, I should retract my claim that it's too late to set TMPDIR in
.Renviron. It doe
Thanks a lot for the confirmation and explanation.
On 2020/8/31 3:45, Henrik Bengtsson wrote:
Sorry, I should retract my claim that it's too late to set TMPDIR in
.Renviron. It does indeed work on Linux and R 4.0.2, e.g.
$ cd
$ mkdir test
$ cd test
$ echo "TMPDIR=$PWD" > ./.Renviron
$ cat ./.R
Sorry, I should retract my claim that it's too late to set TMPDIR in
.Renviron. It does indeed work on Linux and R 4.0.2, e.g.
$ cd
$ mkdir test
$ cd test
$ echo "TMPDIR=$PWD" > ./.Renviron
$ cat ./.Renviron
TMPDIR=/home/hb/test
Rscript --no-init-file -e "tempdir()"
[1] "/home/hb/test/RtmpyH47tc"
I read the help page, I don't understand it very well, since I set the
environmental variable TMPDIR in .Renviron. What confused me is when
double clicking the *.RData to launch R, the tempdir() does not respect
the environmental variable TMPDIR, but launch R by double clicking Rgui
icon does.
It is too late to set TMPDIR in .Renviron. It is one of the
environment variables that has to be set prior to launching R. From
help("tempfile", package = "base"):
The environment variables TMPDIR, TMP and TEMP are checked in turn and
the first found which points to a writable directory is used:
Hi there,
When I started R by double clicking on Rgui icon (I am on Windows), the
tempdir() returned the tmpdir in the directory I set in .Renviron. If I
started R by double clicking on a *.RData file, the tempdir() return the
tmpdir in the directory setting by Windows system. I don't know whe
6 matches
Mail list logo