I am a user (no admin privileges) of an Ubuntu 12.04.4 machine running R 3.1.
I find I can't start R because Fatal error: cannot create 'R_TempDir
. The problem is pretty simple (and already documented here): there's not enough disk space to initialize R temporary directory. Indeed:
df /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda1 10320184 10284088 0 100% /
But then I have plenty of space on a different partition (/dev/vdb
). How could I tell R to create a temporary folder in a different location?
Since I can't start R, I tried to set in my .Rprofile
.First <- function(){
## other stuff
tempdir("path/to/plenty/of/space/tmp")
## other stuff
}
Yet it doesn't work.
Error in tempdir("path/to/plenty/of/space/tmp") :
unused argument ("path/to/plenty/of/space/tmp")
Calls: .First -> tempdir
Execution halted
EDIT: Question already answered here.
Create a .Rprofile
and add this line TMP = '<your-desired-tempdir>'
tempdir()
only returns the temp directory, and cannot change it, event does not get an argument.
But here is a section of manual of the same function, you can see the complete manual using ?tempdir
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.
Hence you need to set the environmental variable TMPDIR
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With