The count_canreg() function is a generic method used to summarize population-based cancer registry data. It supports both single (canreg) and multiple (canregs) registry objects. The function aggregates cancer cases by age group and classifies cancer types using standardized coding systems.

count_canreg(
  x,
  age_breaks = c(0, 1, seq(5, 85, 5)),
  label_tail = NULL,
  cancer_type = "big"
)

# S3 method for class 'canregs'
count_canreg(x, ...)

# S3 method for class 'canreg'
count_canreg(
  x,
  age_breaks = c(0, 1, seq(5, 85, 5)),
  label_tail = NULL,
  cancer_type = "big"
)

Arguments

x

Object with class of 'canreg' or 'canregs'.

age_breaks

A numeric vector specifying the breakpoints for age grouping. Defaults to c(0, 1, seq(5, 85, 5)).

label_tail

Optional. A string to append to age group labels (e.g., "+" for open-ended intervals). Defaults to NULL.

cancer_type

A character string specifying the classification method used to categorize ICD-10 codes. This determines how ICD-10 codes are classified. Options include "big" (classify ICD-10 codes into 26 cancer categories), "small" (classify ICD-10 codes into 59 cancer categories, more specific categories), "system" (classify ICD-10 codes into organ system), and "gco" (classify ICD-10 code into cancer categories same as classification published by the Global Cancer Observatory). This parameter is only available when the input data is a vector of ICD-10 codes, or object with class of 'canreg' or 'canregs'.

...

Additional arguments passed to the method for individual canreg objects.

Value

Object with class of 'fbswicd' or 'fbswicds'.

Examples

data("canregs")
fbsw <- count_canreg(canregs, age_breaks = c(0, 15, 65), cancer_type = "big")
fbsw <- count_canreg(canregs, cancer_type = "gco")

# Count object with class of `canregs`
fbsw <- count_canreg(canregs, cancer_type = "small")

# Count object with class of `canreg`
fbsw <- count_canreg(canregs[[1]], cancer_type = "big")