I have an R script that must read the packages available in a local repository stored on a network location, and I'm using UNC path to refer to that network location:
currPkgs <- pkgAvail(repos="\\\\abc-def.net\\packages\\cran", type="win.binary", Rversion=3.6)[,1]
However I got the error:
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
cannot open compressed file '/\\abc-def.net/packages/cran/bin/windows/contrib/3.6/PACKAGES', probable reason 'No such file or directory'
The function seems to change the slashes in my UNC path so '' were changed to '/' and added an invalid '/\' to the beginning of the path. I've double checked and the file \abc-def.net\packages\cran\bin\windows\contrib\3.6\PACKAGES is definitely present and not corrupted. How do I refer the UNC path properly so that pkgAvail() can find the file?
Thanks!