【发布时间】:2018-04-13 07:09:54
【问题描述】:
我正在尝试使用 R 的 download.file 函数 (Windows 10, R version 3.4.4 (2018-03-15)) 下载 Excel 工作簿 xls。
当我手动(使用 Internet Explorer 或 Chrome)下载文件时,文件会下载,然后我可以在 Excel 中毫无问题地打开它。
当我在 R 中使用 download.file 时,文件会下载但大小小于正确的下载文件 - 该文件是 hmtl 文件,并带有一些说明我的浏览器不受支持的注释。累了不同的模式,没有运气。
我的代码:
download.file(
url = "https://www.atsenergo.ru/nreport?fid=696C3DB7A3F6019EE053AC103C8C8733",
destfile = "C:/MyExcel.xls",
mode = "wb",
method = "auto"
)
【问题讨论】: