2

I've been using Renviron.site to set the R_LIBS_USER path. Now I'd like to share this same folder across several machines so I don't have to maintain multiple sources of packages. I shared a folder using windows SMB and I'm trying the code here:

R_LIBS_USER="//sw20comp02-d/library"

I've tried several variations and they don't work. Here are some:

R_LIBS_USER=//sw20comp02-d/library
R_LIBS_USER=\\\\sw20comp02-d\\library
R_LIBS_USER="//sw20comp02-d/library"
R_LIBS_USER="\\\\sw20comp02-d\\library"

I've found examples where people have similar paths listed, but for some reason it's not working for me.

eg. How do I change the default library path for R packages

variable
  • 1,013
  • 1
  • 12
  • 29
  • Setting it manually via the R command line works if I used the local folder name "D:/R/library" but not the network name. The network name does work in windows explorer. – variable Jul 10 '18 at 15:05
  • 1
    Ok, in case this saves people time. It worked when I shared one folder level deeper. – variable Jul 10 '18 at 15:09
  • What does `.libPaths()` return after you start R with this variable set? – MrFlick Jul 10 '18 at 15:12
  • > .libPaths() [1] "\\\\SW20comp2-d/R/library" "C:/Program Files/R/R-3.4.2/library" Sharing the library folder in windows did not work for some reason, however when I instead shared the R folder, then the R_LIBS_USER parameter started working. – variable Jul 17 '18 at 19:42
  • Does `list.files(.libPaths()[1])` show the packages? What about `list.files("\\\\sw20comp02-d\\library")`? What ever version works in list.files would be the version you need to show up in `.libPaths()`. – MrFlick Jul 17 '18 at 19:48
  • Hi MrFlick, yes list.files(.libPaths()[1]) works. To be clear: I've solved the problem and it wasn't with the format of the string as listed in the original question. It was with which folder windows share was set up on. If I share the R folder it works. If I share the R/library folder, it does not. The format of the R_LIBS_USER parameter was a separate question. Thanks for your help though! – variable Jul 17 '18 at 21:11

0 Answers0