Re: [R] reading file in zip archive

2012-05-31 Thread Iain Gallagher
...@btopenworld.com Cc: r-help r-help@r-project.org Sent: Thursday, 31 May 2012, 0:06 Subject: Re: [R] reading file in zip archive Iain -   Do you see the same behaviour if you use z - unz(pathToZip, 'x.txt') instead of z - unz(pathToZip, 'x.txt','r')                     - Phil Spector

Re: [R] reading file in zip archive

2012-05-31 Thread David Winsemius
if open=rb is any more successful. -- David. Best Iain From: Phil Spector spec...@stat.berkeley.edu To: Iain Gallagher iaingallag...@btopenworld.com Cc: r-help r-help@r-project.org Sent: Thursday, 31 May 2012, 0:06 Subject: Re: [R] reading file in zip archive Iain

[R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
Hi List I have a series of zip archives each containing several files. One of these files is called goCats.txt and I would like to read it into R from the archive. It's a simple tab delimited text file. pathToZip -

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Once you specify the file to unzip in the call to unz, there's no need to repeat the filename in read.table. Try: z - unz(pathToZip, 'goCats.txt', 'r') zT - read.table(z, header=TRUE, sep='\t') (Although I can't reproduce the exact error which you saw.)

Re: [R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
-project.org Sent: Wednesday, 30 May 2012, 20:16 Subject: Re: [R] reading file in zip archive Iain -     Once you specify the file to unzip in the call to unz, there's no need to repeat the filename in read.table.  Try: z - unz(pathToZip, 'goCats.txt', 'r') zT - read.table(z, header=TRUE, sep='\t

Re: [R] reading file in zip archive

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 12:47 PM, Iain Gallagher iaingallag...@btopenworld.com wrote: Hi Phil Thanks, but this still doesn't work. Here's a reproducible example (was wrapping my head around these functions before). x - as.data.frame(cbind(rep('a',5), rep('b',5))) y -

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
] reading file in zip archive Iain -     Once you specify the file to unzip in the call to unz, there's no need to repeat the filename in read.table.  Try: z - unz(pathToZip, 'goCats.txt', 'r') zT - read.table(z, header=TRUE, sep='\t') (Although I can't reproduce the exact error which you saw