hi pete,
try
download.file("http://ir.eia.gov/wpsr/psw09.xls","C:\\Temp\\psw09.xls",mode="wb")
since xls are binary files.
cheers
Am 05.08.2010 23:25, schrieb Pete B:>
> I am trying to download an Excel file from the the internet with the
> following R command
>
>
download.file("http://ir.eia.gov/wpsr/psw09.xls","C:\\Temp\\psw09.xls")
>
> The file is downloaded but when I try and open it I get a message from
Excel
> telling me that the file is corrupt and it cannot be opened.
>
> If I manually download the file it opens without problems.
>
> Any insights would be gratefully received.
>
> Kind regards
>
> Pete
>
>
>
>
--
Eik Vettorazzi
Institut f?r Medizinische Biometrie und Epidemiologie
Universit?tsklinikum Hamburg-Eppendorf
Martinistr. 52
20246 Hamburg
T ++49/40/7410-58243
F ++49/40/7410-57790