Learn R Programming

frheritage (version 0.1.0)

zip_download: Download a ZIP file from a given URL

Description

Downloads a ZIP file from a specified URL and saves it to a temporary file.

Usage

zip_download(url, id)

Value

character or NULL. Path to the temporary ZIP file, or NULL if download fails.

Arguments

url

character. URL to download the ZIP file from.

id

character or numeric. Identifier of the dataset (used for messages).

Details

  • Uses httr2 to perform the HTTP request.

  • If the HTTP response status is not 200, a warning is emitted and NULL is returned.

  • Errors during download are caught and a warning is printed.