Re: [R] problem with loadURL -- claims newer version used- fixed

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (
Date: Tue 11 May 2004 - 17:02:26 EST

Message-id: <Pine.LNX.4.44.0405110748500.19954-100000@gannet.stats>

On Mon, 10 May 2004, William Revelle wrote:

> >big5r.txt is delimited by CR not LF, and as R writes it as a binary file,
> >that's not the file that got saved.
> Thanks. That was the problem. I was transferring the files from my
> Mac to my web server (also a Mac) using Interarchy. It was putting
> in CRs rather than LFs (the Interarchy options were "old Mac cr" vs.
> Unix (lf)"). Changing that transfer option makes it work.
> >
> >Same problem with the header on big5r.
> >
> >Try some octal dumps and find out which step is changing the file.
> >
> >BTW, I would use load(url(someURL)) these days.
> load(url(someURL)) works (once I fixed the transfer to the server),
> although I used the other form because I was following the help for
> load. Perhaps the ?load comments could be modified to suggest
> load(url(someURL)) instead of suggesting loadURL(someURL).

They don't suggest loadURL (that page is also ?loadURL). What they say is

     'load' can load R objects saved in the current or any earlier
     format. It can read a compressed file (see 'save') directly from
     a file or from a suitable connection.

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

A `suitable connection' can include a call to url(), and that has the
advantage (and possibly also disadvantage on a flaky connection) of not
making a local copy.

I will add a warning about needing to preserve binary files, though.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list PLEASE do read the posting guide!

About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:08 EST