- year
Integer. Year(s) of the data. Required.
- type
Character. File type for FTP data (1994--2019). Default:
"DPNI" (doses applied). Use "CPNI" for vaccination coverage.
Ignored for years >= 2020 (API data is always microdata).
- uf
Character. Two-letter state abbreviation(s) to download.
If NULL (default), downloads all 27 states.
Example: "SP", c("SP", "RJ").
- month
Integer. Month(s) to download (1--12). For years >= 2020
(CSV), selects which monthly CSV files to download. For years <= 2019
(FTP), this parameter is ignored (FTP files are annual).
If NULL (default), downloads all 12 months.
- vars
Character vector. Variables to keep. If NULL (default),
returns all available variables. Use sipni_variables() to see
available variables.
- parse
Logical. If TRUE (default), converts columns to
appropriate types (integer, double, Date) based on the variable
metadata. Use sipni_variables() to see the target type for
each variable. Set to FALSE for backward-compatible all-character output.
- col_types
Named list. Override the default type for specific
columns. Names are column names, values are type strings:
"character", "integer", "double",
"date_dmy", "date_ymd", "date_ym", "date".
Example: list(QT_DOSE = "character") to keep QT_DOSE as character.
- cache
Logical. If TRUE (default), caches downloaded data for
faster future access.
- cache_dir
Character. Directory for caching. Default:
tools::R_user_dir("healthbR", "cache").
- lazy
Logical. If TRUE, returns a lazy query object instead of a
tibble. Requires the arrow package. The lazy object supports
dplyr verbs (filter, select, mutate, etc.) which are pushed down
to the query engine before collecting into memory. Call
dplyr::collect() to materialize the result. Default: FALSE.
- backend
Character. Backend for lazy evaluation: "arrow"
(default) or "duckdb". Only used when lazy = TRUE.
DuckDB backend requires the duckdb package.