- file_path
Optional character string, path to a CCSR mapping file. Can be:
A ZIP file path (will be extracted and read)
A CSV/Excel file path (will be read directly)
A directory path containing extracted CCSR files
If NULL (default), automatically searches the cache directory for files
downloaded via download_ccsr().
- type
Character string specifying the type of CCSR file. Must be one
of: "diagnosis" (or "dx") for ICD-10-CM diagnosis codes, or "procedure"
(or "pr") for ICD-10-PCS procedure codes. If NULL and file_path is NULL,
defaults to "diagnosis". If file_path is provided, the function will
attempt to infer the type from the file name or contents.
- version
Character string specifying the CCSR version to read from cache.
Use "latest" (default) to read the most recent version, or specify a version
like "v2026.1", "v2025.1", etc. Only used when file_path is NULL.
- clean_names
Logical. If TRUE (default), column names are cleaned to
follow R naming conventions (snake_case).
- as_data_table
Logical or NULL. If TRUE and the data.table package is
available, returns a data.table object instead of a tibble. If FALSE,
returns a tibble. If NULL (default), prompts the user interactively to
choose (only in interactive sessions). In non-interactive sessions, defaults
to FALSE. Note: tibbles are already data frames and work with all standard
R data frame operations.
- name
Optional character string, suggested variable name for the
returned data. This is only used for display/messaging purposes and does
not automatically assign the data to a variable. You must still assign the
result: my_data <- read_ccsr(). If NULL (default), a name is suggested
based on the file type and version.