download_comprehensive_data: Download the comprehensive ZIP code database

View source: R/data_version.R

download_comprehensive_dataR Documentation

Download the comprehensive ZIP code database

Description

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 published as a checksum-pinned asset of a zipcodeR data release rather than shipped in the package. Its public URL, checksum, and SQLite integrity have passed a clean-machine smoke test.

Usage

download_comprehensive_data(force = FALSE)

Arguments

force

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

Details

This function downloads that database, verifies its SHA256 checksum, and, on R 4.0 or newer, caches it under tools::R_user_dir("zipcodeR", "data"); later calls return the cached path immediately. On older supported R versions the verified file is kept only in the session temporary directory. It never downloads without being called explicitly. For offline use on R 4.0 or newer, copy the file to that user data directory yourself (the expected file name is the asset name from the data release).

Value

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

Examples

## Not run: 
path <- download_comprehensive_data()

## End(Not run)

zipcodeR documentation built on Sept. 7, 2026, 5:06 p.m.