How to read files from a UNC-specified directory in R?

萝らか妹 提交于 2019-11-30 23:15:31

UNC names work fine, you just have to escape them correctly. This works for me:

read.csv('\\\\COMPUTER\\Directory\\file.txt')

adding to nograpes answer ... you can avoid the escaping ugliness by using forward slashes ... this works as well

read.csv('//COMPUTER/Directory/file.txt')

a slightly more cross-platform approach

# the two '' are required to represent the two leading slashes of the UNC path
read.csv(file.path('', '', 'COMPUTER', 'Directory' 'file.txt'))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!