I am looking for a way to change the tempdir()
location after an R session has started. I think it would be required to update the C level global variable
The tempdir()
function is a nice way to create a temporary directory so you can store files valid during the last of the session. It returns a temporary directory created at the beginning of the session, and is where new temporary files created by tempfile()
are stored by default.
However it's not related to the working directory. If you want to change the working directory you should use the command setwd()
.
If you want to change the directory where temporary files are stored, you should set this as a parameter on the command.
tempfile(tmpdir="/my/path/to/tmpfile")