The bundled zip_code_db is the lightweight ("simple") dataset. A much larger companion database with detailed ACS demographic profiles per ZIP code (the "comprehensive" database, ~450 MB SQLite) is intended to be published as an asset of a zipcodeR data release rather than shipped in the package. The downloader is disabled until that asset is public and its URL and checksum have passed a clean-machine smoke test.

download_comprehensive_data(force = FALSE)

Arguments

force

If TRUE, re-download even if a verified copy is cached.

Value

Invisibly, the path to the downloaded SQLite database. Query it with DBI/RSQLite, e.g. DBI::dbConnect(RSQLite::SQLite(), download_comprehensive_data()).

Details

Once enabled, this function downloads that database, verifies its SHA256 checksum, and caches it under tools::R_user_dir("zipcodeR", "data"); later calls return the cached path immediately. It never downloads without being called explicitly. For offline use, copy the file to that directory yourself (the expected file name is the asset name from the data release).

Examples

if (FALSE) { # \dontrun{
path <- download_comprehensive_data()
} # }