Skip to content
Prev 385505 / 398506 Next

tempdir() does not respect TMPDIR

Thanks a lot for the confirmation and explanation.
On 2020/8/31 3:45, Henrik Bengtsson wrote:
This works just becuase .Renviron is in the same directory R launched. 
It confirmed what you stated that launched Rgui via double-clicking 
.RData. Generally, we put .Renviron in R_USER (on Windows).
I should guess to that you said. When I launched R from console (cmd on 
Windows) by command like:

C:\Users\zjs>"c:\Program Files\R\R-4.0.2\bin\R.exe"
or
C:\Users\zjs>"c:\Program Files\R\R-4.0.2\bin\x64\Rgui.exe"

The tempdir() does not return the value I set in .Renviron. It means 
when R launching, it search .Renvrion in the current directory. If it 
does not get the .Renviron, it does not search it in R_USER. Am I right?

So where I set TMPDIR, R would use it whenever it launched? The purpose 
that I tried to set TMPDIR is RStudio may refuse to work when user name 
contained non-latin characters.

Thanks again.

Best,
Jinsong