I am looking for a simple student-proof way to specify a custom TMPDIR
in R sessions.
R seems unable to expand ~
or $USER
, so if I simply write TMPDIR=~/tmp
or TMPDIR=$HOME/tmp
in .Renviron
it does not find the folder, and uses /tmp
instead, which is mounted noexec
, causing compilation errors for some packages. I have to use the full path to the folder instead, which is different for each student.
The workaround I know of is to set TMPDIR
in Bash and export it before calling R, I would like to know if there is a simpler way that does not depend on the actual home directory path. Ideally, I would like to give all students the same .Renviron file, and not have them use the shell at all.