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