0

So I have a problem with UNC paths. According to other unc related topic, the correct form should be:

source <- read.csv("\\\\W:\\Reports\\report.csv")

but then I got the error message:

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file '\\W:\Reports\report.csv': Invalid argument

As a user I have access to that very folder and file - I am positive about it.

megakot
  • 3
  • 2

1 Answers1

1

You are not using UNC paths. A UNC path would be something like "\\\\myserver\\C$\\Users" or "//myserver/C$/Users"or "//myserver/Users". What you are using is a mapped drive or a mapped network drive. They are an alternative to UNC paths. Try this instead:

read.csv("W:\\Reports\\report.csv")

or forward slashes:

read.csv("W:/Reports/report.csv")
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341
  • Unfortunately, both don't work. W: is indeed a mapped drive, the unc path in this case is \\spplfapcen05\. So my code is source <- read.csv("\\\\spplfapcen05\\Reports\\report.csv") – megakot Dec 23 '16 at 08:16
  • You likely have the path wrong then. Type `file.choose()` at the R prompt and navigate to the `report.csv` file. Then, when you press Open in the navigation dialogue, R will return the path. – G. Grothendieck Dec 23 '16 at 13:00