Skip to contents

Downloads the requested survey years, and by default also the data manifest and the metadata catalogs (variables, labels, the rename crosswalk, and the year inventory), so that everything works offline afterwards: read_brfss(), brfss_design(), brfss_vars(), brfss_labels(), brfss_crosswalk(), brfss_year_info(), and labels/na conversion all run from the cache. Use it to populate the cache once on a connected machine (the directory from brfss_cache_dir() can then be copied to an air-gapped one), or to pre-download years ahead of a workshop. Files already cached and current are not re-downloaded.

Usage

brfss_download(years = NULL, catalogs = TRUE, quiet = FALSE)

Arguments

years

Optional integer vector of survey years to cache. NULL fetches only the metadata.

catalogs

If TRUE (the default), also cache the manifest and the metadata catalogs.

quiet

If TRUE, suppress download progress and the summary.

Value

Invisibly, the brfss_cache_info() tibble after the fetch.

Examples

if (FALSE) { # interactive()
brfss_download(2019:2023)
}