[R] Comment on loadURL: should default to mode="wb"

Seth Falcon sfalcon at fhcrc.org
Sat Feb 19 01:56:25 CET 2005


So the help for loadURL says:

     'loadURL' is a convenience wrapper which downloads a file, loads
     it and deletes the downloaded copy.

Trying to load an rda file on Windows (XP, R-devel) I was surprised
when I received an error about input being corrupted with LF
replaced by CR.

The fix was to specify mode="wb" to loadURL.  This gets passed to
download.file and the right thing happens... 

On unix platforms it doesn't matter whether mode="w" or mode="wb".

Will loadURL ever do anything useful on Windows without passing
mode="wb"?  If not, I think changing the default (in loadURL) to
mode="wb" would be a nice improvement.

Best,

+ seth




More information about the R-help mailing list