[R] Looking for example of usage of function unz

(Ted Harding) Ted.Harding at manchester.ac.uk
Tue Jul 28 14:50:48 CEST 2009


On 28-Jul-09 12:15:33, mauede at alice.it wrote:
> I would greatly appreciate some example of correct usage of
> function unz.
> I have to download and  uncompress the following web compressef file:
> ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapiens.z
> ip
> 
> I tried the following command that does not work:
> 
> Targets.rec <- readLines(zz <-
> unz("ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.homo_sapi
> ens.zip"))
> 
> Thank you in advance,
> Maura

Maura, unz() is insisting that you give the "filename" argument,
which, according to '?unz', is:

  filename: a filename within a zip file.

This means that you would first need to know the name[s] of the
file[s] archived in the .zip file, as far as I can see.

So, in that case, a first step would be to download the .zip
file anyway, to your local system, and then, in whatever way is
appropriate for your system ("unzip -l ...." in Linux), find
out what the files in it are called.

But once you have got that far, you may prefer to handle the .zip
file outside of R ...

Hoping this helps,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09                                       Time: 13:50:45
------------------------------ XFMail ------------------------------




More information about the R-help mailing list