[R] Reading zipped data directly from an FTP url
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Oct 9 12:15:23 CEST 2008
On Thu, 9 Oct 2008, michael watson (IAH-C) wrote:
> Sorry, I am clearly missing something here.
Yes, you need to use unz() for a zip file, and it does not handle urls
(only url does). So download the file (download.file()) first.
> I want to read this file directly:
> I tried using
> But I got an error:
> Error in open.connection(file, "r") : cannot open the connection
> In addition: Warning message:
> In open.connection(file, "r") :
> cannot open compressed file
> .zip', probable reason 'No such file or directory'
> With all the different ways of opening connections (url(), unz(),
> gzfile(), gzcon() etc) I am just getting a bit lost. The above zip
> archive contains a single tab-delimited file, but one which I need to
> skip the first 5 lines.
> Any help appreciated!
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
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
More information about the R-help