UNC-paths for read.csv in R

712 views Asked by At

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.

1

There are 1 answers

2
G. Grothendieck On

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")