Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

R | How to unzip a file

Sometimes code functionality is dependent on files inside compressed archives. To extract files without having to resort to command line or GUI actions, base R has a function called unzip [1] that will do so based on a list of files to be extracted.

Using the list argument, it is also possible to use this function to return a list of files inside the archive without actually unzipping anything, making it possible to perform pattern-based filters on which files to extract when combined with the grep function in base R.

Resources:

[1] https://stat.ethz.ch/R-manual/R-devel/library/utils/html/unzip.html

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.