4

是否可以从 UNC 指定的目录中读取文件R?我想在不使用基本安装之外的任何包的情况下做到这一点。

4

3 回答 3

7

UNC 名称工作正常,您只需正确转义它们。这对我有用:

read.csv('\\\\COMPUTER\\Directory\\file.txt')
于 2013-09-09T09:29:06.507 回答
4

稍微跨平台的方法

# the two '' are required to represent the two leading slashes of the UNC path
read.csv(file.path('', '', 'COMPUTER', 'Directory' 'file.txt'))
于 2015-09-25T20:27:10.193 回答
3

添加到 nograpes 答案...您可以通过使用正斜杠来避免逃避丑陋...这也可以

read.csv('//COMPUTER/Directory/file.txt')
于 2015-05-08T18:51:39.100 回答