问题
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:
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")
来源:https://stackoverflow.com/questions/41285716/unc-paths-for-read-csv-in-r