Skip to contents

Download data and metadata from the Centers for Disease Control and Prevention (CDC).

Usage

dcf_download_cdc(
  id,
  out_dir = "raw",
  state = NULL,
  parquet = FALSE,
  verbose = TRUE
)

Arguments

id

ID of the resource (e.g., ijqb-a7ye).

out_dir

Directory in which to save the metadata and data files.

state

The state ID of a previous download; if provided, will only download if the new state does not match.

parquet

Logical; if TRUE, will convert the downloaded CSV file to Parquet.

verbose

Logical; if FALSE, will not display status messages.

Value

The state ID of the downloaded files; downloads files (<id>.json and <id>.csv.xz) to out_dir

data.cdc.gov URLs

For each resource ID, there are 3 relevant CDC URLs:

Examples

if (FALSE) { # \dontrun{
  dcf_download_cdc("ijqb-a7ye")
} # }