Returns formatted labels (with optional units) for commonly used statistical variables in cancer registry reporting, such as incidence, mortality, crude rate, age-standardized rate, and proportion.
add_var_labels(x, label_type = "abbr", lang = "cn", break_line = TRUE)A character vector of variable codes to be labeled (e.g., "cr", "asr", "prop").
Label style: "abbr" (default) for abbreviation, "full" for full name.
Language for the labels. One of "cn" (default) for Chinese, "en" for English.
Special options "code" or "icd10" return the variable code or ICD-10 code instead.
Logical. If TRUE (default), adds a line break (\\n) before the unit.
If FALSE, appends the unit directly after the label, suitable for HTML rendering
(e.g., in flextable).
A character vector of the same length as x, where each element is a formatted label.
This function looks up the corresponding label for each input variable code
in the internal dictionary tidy_var_maps[["stats"]], and optionally adds
a unit suffix (e.g., (1/10<sup>5</sup>) or (%)) depending on the variable type.
It supports Chinese and English, full names or abbreviations, and can format
the unit with or without a line break.