Reads cancer registry data from one or more Excel files or from
a directory containing Excel files. It extracts case and population data and
returns objects of class "canreg" or a list of such objects ("canregs").
Usage
read_canreg(
x,
pop_type = "long",
age_var = "agegroup",
pop_var = "popu",
death_var = "death"
)Arguments
- x
A path to an Excel file, a character vector of file paths, or a directory containing Excel files.
- pop_type
A character string specifying the format of the population sheet. Must be either
"long"(default) or"wide".- age_var
Name of the age group column (used only when
pop_type = "long"). Default is"agegroup".- pop_var
Name of the population count column (used only when
pop_type = "long"). Default is"popu".- death_var
Name of the death count column (used only when
pop_type = "long"). If not present in the sheet, a column with 0s will be added. Default is"death".
