...@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
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
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 -
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.)
-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
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 -
] 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
7 matches
Mail list logo