1

I am working on my data science work on a linux server but I know very little about linux. When I submit my Rscript I got this Error:

Fatal error: cannot create 'R_TempDir'

However, I can directly open R like this:

[xxx@x xxx]$ R

R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Here is some more information:

[xxx@x xxx]$ df -lh /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/os_vg-lvTmp
                      9.8G   52M  9.2G   1% /tmp

Could you please kindly give me the detailed instructions on how to fix this fatal error? Since I am really puzzled about how the system work or not work. Thanks a lot!

  • 1
    Can you share directory permissions ? `ls -l ..` and `pwd` commands would be helpful. Be sure to run these commands on the same directory you are trying to run the R program. Btw can you share the code or show where your code tries to create a directory ? – Catastrophe Apr 13 '21 at 08:00
  • Make sure that permissions for `/tpm` have write permission for your user. Something along the lines of `sudo chmod +w /tmp`. – Roman Luštrik Apr 13 '21 at 08:09
  • See: [Fatal error: cannot mkdir R_TempDir](https://stackoverflow.com/q/6307836/10488504) – GKi Apr 13 '21 at 08:15
  • @Catastrophe Here are the results: `[user@master CODE]$ ls -l .. total 8 drwxrwxr-x 4 user user 4096 Apr 13 16:33 CODE drwxrwxr-x 6 user user 4096 Apr 13 10:48 Rlib` and `[user@master CODE]$ pwd /data/user/CODE` I am not creating a directory in my R code, in fact, when I am running the code like this`"=========" ` I still got this error. – Shuang_Stat Apr 13 '21 at 08:43
  • @RomanLuštrik Thanks for your help, but sorry I have no sudo access. – Shuang_Stat Apr 13 '21 at 08:49
  • @GKi Thanks! I tried some of solutions in the referred question, but they didn't work. Besides when it comes to environment variables, I am really confused about what exactly should I do. – Shuang_Stat Apr 13 '21 at 09:14

0 Answers0