R中read.csv的UNC路径

时间:2016-12-22 14:45:35

标签: r unc

所以我对UNC路径有疑问。根据其他相关主题,正确的形式应该是:

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

但后来我收到了错误消息:

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

作为一个用户,我可以访问该文件夹和文件 - 我对此持肯定态度。

1 个答案:

答案 0 :(得分:1)

您没有使用UNC路径。 UNC路径类似于"\\\\myserver\\C$\\Users""//myserver/C$/Users""//myserver/Users"。您使用的是映射驱动器或映射的网络驱动器。它们是UNC路径的替代方案。试试这个:

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

或正斜杠:

read.csv("W:/Reports/report.csv")
相关问题