How exactly are you setting the temporary directory? The R documentation in ?tempdir
says this:
By default, tmpdir will be the directory given by tempdir(). This will be a subdirectory of the per-session temporary directory found by the following rule when the R session is started. The environment variables TMPDIR, TMP and TEMP are checked in turn and the first found which points to a writable directory is used: if none succeeds ‘/tmp’ is used. The path should not contain spaces. Note that setting any of these environment variables in the R session has no effect on tempdir(): the per-session temporary directory is created before the interpreter is started.
Presumedly, if you have the TMPDIR
environment variable set, R (and hence RStudio) should just do the right thing. Note that you'll have to set before R / RStudio is launched; odds are you can accomplish this by setting it within ~/.Renviron
or ~/.Rprofile
.
See also: Change temporary directory