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
Prof Brian Ripley
2005-Feb-19 06:42 UTC
[R] Comment on loadURL: should default to mode="wb"
On Fri, 18 Feb 2005, Seth Falcon wrote:> 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.Yes of course, as almost all Web files are text and the default is correct for them. Why are you using an out-dated interface anyway? See the examples for loadURL! -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Possibly Parallel Threads
- problem with loadURL -- claims newer version used
- AEC in WB mode fixed yet ?
- Noisy sound quality with Blackfin in WB-mode
- Suggestion: Change default to download.file(..., mode="wb") ...instead of mode="w" with some bells and whistles
- Noisy sound quality with Blackfin in WB-mode