temp <- tempfile()
download.file("file://connect/me/test.gz",temp)
这个URL存在,因为我可以在浏览器中打开它,但是当我运行那段代码时出现了错误:
Error in download.file("file://connect/me/test.gz", :
cannot open URL "file://connect/me/test.gz", reason 'No such file or directory'
你有什么想法,如何下载文件并解压缩?
更新
我在fil://这里找到一些信息 https://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html:
"关于file:// URLs的说明。最一般的形式(来自RFC1738)是file://host/path/to/file,但R只接受一个空主机字段引用本地机器的形式。"
"在这种形式中,路径相对于文件系统的根,而不是Windows的概念。标准形式在Windows上是file:///d:/R/repos:为了与早期版本的R和Unix版本兼容,任何其他形式都被解释为file://加上path_to_file。此外,在路径内接受反斜杠,即使RFC1738不允许也可以。"
这是什么意思?
谢谢
/
?像这样:download.file("file://connect//me//test.gz",temp)
。 - David Arenburg