UNC-paths for read.csv in R

本小妞迷上赌 提交于 2020-01-07 05:01:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!