download.file“操作超时”错误与大文件

时间:2015-01-05 11:39:58

标签: r ftp rstudio

我在Windows 7 32位上使用R 3.1.2和RStudio 0.98。

我想下载一些GFS模型的天气预报文件,可以在开放的ftp服务器上找到,例如:

ftp://nomads.ncdc.noaa.gov/GFS/Grid4/201412/20141221/gfs_4_20141221_0000_000.grb2

互联网连接是通过代理完成的(.Renviron已正确配置),我基本上是为了这个目的而使用donwload.file函数。

url <- file.path("ftp://nomads.ncdc.noaa.gov/GFS/Grid4/201412/20141221/gfs_4_20141221_0000_000.grb2")
download.file(url, destfile="temp.grb2", mode="wb")

我收到以下错误消息:

trying URL 'ftp://nomads.ncdc.noaa.gov/GFS/Grid4/201412/20141221/gfs_4_20141221_0000_000.grb2' using Synchronous WinInet calls Error in download.file(url, destfile = "temp.grb2", mode = "wb", : cannot open URL 'ftp://nomads.ncdc.noaa.gov/GFS/Grid4/201412/20141221/gfs_4_20141221_0000_000.grb2' In addition: Warning message: In download.file(url, destfile = "temp.grb2", mode = "wb", : InternetOpenUrl failed: 'Operation timed out'

此消息在运行这些行后30秒正好显示,并且在下载较小的文件时不会出现问题,例如&#39; ftp://nomads.ncdc.noaa.gov/GFS/Grid4/201412/20141221/gfs_4_20141221_0000_000.inv&#39;,所以我认为这是一个问题。超时配置。 设置: options(timeout=240)似乎无法运作。

使用另一台计算机,在Windows 8 64位上使用R 3.0.2和RStudio 0.98,并且不使用代理连接,它完美无缺。

有什么建议吗?

0 个答案:

没有答案