From ripley@stats.ox.ac.uk  Wed Dec  4 20:22:12 2002
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Wed Dec  4 20:22:12 2002
Subject: [Rd] problem with load('http://....') (PR#2344)
In-Reply-To: <Pine.LNX.4.44.0212041302140.31841-100000@itasca.stat.uiowa.edu>
Message-ID: <Pine.LNX.4.31.0212041918030.6357-100000@gannet.stats>

On Wed, 4 Dec 2002, Luke Tierney wrote:

> On Wed, 4 Dec 2002 ripley@stats.ox.ac.uk wrote:
>
> > On 4 Dec 2002, Peter Dalgaard BSA wrote:
> >
> > > fharrell@virginia.edu writes:
> > >
> > > > Full_Name: Frank Harrell
> > > > Version: 1.6.1
> > > > OS: RedHat 8.0 Linux
> > > > Submission from: (NULL) (128.143.108.90)
> > > >
> > > >
> > > > I get an error when trying to load a URL that contains a file that was saved
> > > > using save(object, compress=TRUE):
> > > >
> > > > > load('http://hesweb1.med.virginia.edu/biostat/s/data/sav/kprats.sav')
> > > > Error in gzfile(file, "rb") : unable to open connection
> > > > In addition: Warning message:
> > > > cannot open compressed file
> > > > `http://hesweb1.med.virginia.edu/biostat/s/data/sav/kprats.sav'
> > > >
> > > > The above file will remain at that URL for your testing.
> > >
> > > The root of the issue is that gzfile() doesn't know about URLs. Not
> > > documented to either, but (on the face of things) it would seem easy
> > > to add the feature.
> >
> > Right, this is not what the `file' argument of load() is documented as.
> > That is neither a file name nor a connection.
> >
> > I am worried about attempting to get a binary file over a url connection,
> > but in principle what you should do is
> >
> > load(url('http://hesweb1.med.virginia.edu/biostat/s/data/sav/kprats.sav'))
> >
> > That fails I think because the connection cannot handle binary files,
> > but I will look further when I have time.
> >
>
> Not sure if being binary creates problems as such, but what the
> connection would provide if it is working properly is the compressed
> data, and we wo not currently have the tools to decompress off a
> connection, as far as I know.

What I meant was that an ASCII save file (rather than a binary save file)
should work via url().

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] problem with load('http://....') (PR#2344)
ripley@stats.ox.ac.uk