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
______________________________________________
[email protected] 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.