Downloads compressed archive files from a URL and extracts their contents to a specified directory. Supports multiple archive formats and handles permission confirmation.
get_archive_data(url, target_dir, force = FALSE, confirmed = FALSE)Character string. Full URL to the compressed archive file.
Character string. Directory where the archive contents should be extracted.
Logical. If TRUE, overwrites existing data in target directory. Default is FALSE.
Logical. If TRUE, skips permission confirmation prompt. Useful for reproducible workflows. Default is FALSE.
Invisible NULL. Called for side effects:
Downloads archive file
Creates target directory if needed
Extracts archive contents
Cleans up temporary files
Supported archive formats:
ZIP (.zip)
Gzip (.gz)
Tar (.tar)
Compressed tar (.tgz)
The function includes safety features:
Permission confirmation for data usage
Directory existence checks
Archive format validation
Automatic file cleanup