temp <- tempfile()
download.file("file://connect/me/test.gz",temp)
该网址存在是因为我可以将其放入浏览器中,但是当我运行该代码时,出现错误:
Error in download.file("file://connect/me/test.gz", :
cannot open URL "file://connect/me/test.gz", reason 'No such file or directory'
我有什么想法可以下载该文件并解压缩它吗?
UPDATE
我在这里找到了一些关于 fil:// 的信息https://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html https://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html:
“关于 file:// URL 的注释。最通用的形式(来自 RFC1738)是 file://host/path/to/file,但 R 只接受带有引用本地计算机的空主机字段的形式。”
“在这种形式中,路径是相对于文件系统根的,而不是 Windows 概念。Windows 上的标准形式是 file:///d:/R/repos:为了与早期版本的 R 和 Unix 版本兼容,任何其他形式被解析为 R 作为 file:// 加 path_to_file。此外,即使 RFC1738 不允许,路径中也接受反斜杠。”
这意味着什么?
ty
我想到了。我必须将驱动器“B”映射到该文件夹,然后
temp <- tempfile()
download.file("file:///B:/me/test.gz",temp,method="internal")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)