Skip to contents

Extracts the contents of a .zip file into a uniquely named subdirectory in the same location as the original file. The output folder is named after the zip file with a _unzipped suffix.

Usage

zip_file(f)

Arguments

f

Character. Full path to the .zip file to be extracted.

Value

A character string indicating the full path to the directory where the contents were (or would have been) unzipped.

Details

If the target directory already exists and contains files or subdirectories, the function skips unzipping and returns the existing directory path.

Examples

if (FALSE) { # \dontrun{
zip_path <- "/path/to/hildap_vGLOB-1.0_geotiff.zip"
unzipped_dir <- zip_file(zip_path)
list.files(unzipped_dir)
} # }