[R] zip.file.extract

Duncan Murdoch murdoch at stats.uwo.ca
Thu Mar 19 20:16:46 CET 2009


On 3/19/2009 2:30 PM, Li, Xuejun wrote:
> Hello everyone,
> 
>  
> 
> Can anyone give me some hint/suggestion for unzipping a file in R?  The
> help file for "zip.file.extract" function seems to be difficult to
> understand.  
> 
>  
> 
> For example, the name of my zip file is "refGene.txt.gz", which is
> located in "C:\Documents and Settings\Desktop\test1".  I would like to
> unzip this file to the same directory.

That seems fairly unlikely to be a zip file; it looks like a gzip file, 
based on the extension.

zip.file.extract is for zip archives.  The closest equivalent in the 
gzip world is a .tar.gz file.

I don't know if there is a built-in gunzip function, but you can call a 
system function using system().

Duncan Murdoch

> 
>  
> 
> Here's the syntax from the help file, 
> 
>  
> 
> zip.file.extract(file, zipname = "R.zip", unzip = getOption("unzip"))
>  
> What I should use for the "file" and the "zipname" arguments?  I tried
> different ways, but none of them is working.  Thank you!
>  
> Best regards,
>  
> Arthur
> 
>  
> 
>  
> 
>  
> 
> Arthur Xuejun Li
> 
> City of Hope Comprehensive Cancer Center
> 
> Department of Information Science
> 
> 1500 East Duarte Road
> 
> Duarte, CA 91010 - 3000
> 
> Ph:   (626) 256-4673 ext. 65121
> 
> Fax: (626) 471-7106
> 
>  
> 
> 
> 
> ---------------------------------------------------------------------
> 
> SECURITY/CONFIDENTIALITY WARNING:  \ This message an...{{dropped:23}}
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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