When attempting to run R, I get this error:
Fatal error: cannot mkdir R_TempDir
I found two possible fixes for this problem by googling around. The first was to ensure my tmp directory didn’t contain a load of subdirectories – it doesn’t and it’s virtually empty. The second fix was to ensure that TMP, TMPDIR, and R_USER in my environment weren’t set to non-existent paths – I didn’t even have these set. Therefore, I created a tmp directory in my home directory and added it’s path to TMP in my environment. I was able to run R once and then I got the fatal error again. Nothing was in the TMP directory that I set in my environment. Does anyone know what else I can try? Thanks.
Your default temporary directory appears to have the wrong permissions. Here I have
The key part is ‘everybody’ can read or write. You need that too. It certainly can contain subdirectories.
Are you running something like AppArmor or SE Linux?
Edit 2011-07-21: As someone just deemed it necessary to downvote this answer —
help(tempfile)is very clear on what valuestmpdir(the default directory for temporary files or directories) tries:So my money is on checking those three environment variables. But AppArmor and SELinux have shown to be an issue too on some distributions.