Similar to unzip, but makes it easier to unzip all files in a given path with one function call.
Usage
unzip_data(
path = getwd(),
to = NULL,
overwrite = FALSE,
recursive = TRUE,
.progress = TRUE
)Arguments
- path
The path to the directory containing the zip files.
- to
The output path.
- overwrite
Logical value whether you want to overwrite already existing zip files.
- recursive
Logical value indicating whether to unzip files in subdirectories as well. These files will then be unzipped in their respective subdirectory.
- .progress
Whether to display a progress bar.
Parallel
This function supports parallel processing in the sense that it is able to
distribute it's computation load among multiple workers. To make use of this functionality, run
future::plan("multisession") before
calling this function.
Examples
if (FALSE) { # \dontrun{
# Unzip all files in a directory
unzip_data(path = "path/to/zipfiles", to = "path/to/unzipped", recursive = FALSE)
# Unzip all files in a directory and its subdirectories
unzip_data(path = "path/to/zipfiles", to = "path/to/unzipped", recursive = TRUE)
# Unzip files in a directory, but skip those that are already unzipped
unzip_data(path = "path/to/zipfiles", to = "path/to/unzipped", overwrite = FALSE)
} # }
