[R] How to unzip a .gz file

Benno Pütz puetz at mpipsykl.mpg.de
Tue Feb 10 23:10:35 CET 2015


readLines (as well as other I/O routines) handles gzip files transparently, you should be able to simply use

	readLines('/home/file.gz’)


Benno

On 10 Feb 2015, at 22:45 , Alexandra Catena <amc5981 at gmail.com> wrote:

> Hello,
> 
> Can someone help me with unzipping a .gz file.  I used:
> 
> readLines(gzfile('/home/file.gz'))
> 
> 
> I also found that I could use gunzip, but after trying to install it, it
> says:
> 
> "package ‘gunzip’ is not available (for R version 2.15.1)"
> 
> 
> Thanks,
> Alexandra
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list