[R] Problems downloading file

R. Michael Weylandt michael.weylandt at gmail.com
Thu Mar 1 15:54:32 CET 2012


It might be a local network or OS issue: this works fine for me on my
personal Mac

download.file(url = "http://ir.eia.gov/wpsr/psw09.xls", destfile =
"~/herewego.xls", mode = "wb")

Someone with more Windows knowledge may have to help you out, but
often using IE settings (activated by the setInternet2 command if I
recall correctly) is a good first move.

Michael

On Thu, Mar 1, 2012 at 9:47 AM, Pete Brecknock <Peter.Brecknock at bp.com> wrote:
> I am running the following line to download data from the US Energy
> Information Administration. This function has worked successfully for me in
> the past but yesterday gave the error/warning messages below.
>
> If I simply type "http://ir.eia.gov/wpsr/psw09.xls" (no quotes) into a
> browser, the file is available to download.
>
> I am running R 2.13.0 on Windows XP.
>
> # Download File Attempt
> download.file("http://ir.eia.gov/wpsr/psw09.xls","c:\\temp\\psw09.xls",mode="wb")
>
> # Error & Warning Messages
> trying URL 'http://ir.eia.gov/wpsr/psw09.xls'
> Error in download.file("http://ir.eia.gov/wpsr/psw09.xls",
> "c:\\temp\\psw09.xls",  :
>  cannot open URL 'http://ir.eia.gov/wpsr/psw09.xls'
> In addition: Warning message:
> In download.file("http://ir.eia.gov/wpsr/psw09.xls", "c:\\temp\\psw09.xls",
> :
>  InternetOpenUrl failed: 'The operation timed out'
>
> Thanks for any insights.
>
> Pete Brecknock
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Problems-downloading-file-tp4435186p4435186.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list