8

First, apologies for a lack of a reproducible example, but I cannot really provide one as I believe the problem lies within my network settings. Please treat this question as a call for help in debugging the issue...

After opening in RStudio a project stored on a network drive and running the very first instruction (being it a package load or even a <- 1) I am seeing a really weird output in the console:

> a <- 1
Warning message:
In dir.create(tempPath, recursive = TRUE) :
  cannot create dir 'F:\Marketing', reason 'Permission denied'

I have all possible temp dirs set up in user environment variables (TEMP, TMP, TMPDIR) and Sys.getenv() is printing them correctly.

"F:\Marketing" is a valid path on my network drive and it is a root directory of the project.

I have tried to debugonce(dir.create) in .RProfile to see what the tempPath is, but unfortunately this resulted in an "invalid 'envir' argument" error.

After copying the project to a local drive the problem disappears, so this is clearly a network drive/network setup problem, but I do not know where to dig more and my IT dept. is not really useful here...

Any ideas how to debug this warning?

M--
  • 25,431
  • 8
  • 61
  • 93
m-dz
  • 2,342
  • 17
  • 29
  • My sense is if you are on Windows that you need to check your R program code for `F:\Marketing` and replace with `F:\\Marketing` or `F:/Marketing`. Why There are a number of R functions that expect a character string containing a file name, which may need to include the path to that file. The form of path names in Windows has an unfortunate collision with R. The separator in the path names is the backslash, which in R is the escape character in characters strings. – Technophobe01 Jul 11 '17 at 00:23
  • I hope this helps - if not I can try and reproduce on a Windows machine. – Technophobe01 Jul 11 '17 at 00:28
  • 1
    When opening a project, RStudio creates a `.Rproj.user` folder in the project folder. I don't think you can change that, so you might want to ask you admins for the right to create subfolders – HubertL Jul 12 '17 at 20:27
  • Apologies everyone, I took a longer break from work to travel a bit and my "Internet" duties suffered a bit as well. @Technophobe01, I am afraid it has nothing to do with "path character strings", as it happens after running any instruction, e.g. the `a <- 1` from my example. – m-dz Aug 27 '17 at 11:47
  • @HubertL, this is also a good point, but the problem arises after opening the project, when the first instruction is being run. I need to check when exactly `.Rproj.user` is being created. Or this might be the `.Rhistory` file? – m-dz Aug 27 '17 at 11:49

0 Answers0