Internal helper function to retrieve the province name corresponding to a given province code. Works with either harmonized or non-harmonized codes.
reg_name(code, harmonized = TRUE)A character string with the corresponding province name.
Integer or character. The province code to look up.
Logical. If TRUE (default), the function searches using
harmonized province codes. If FALSE, it uses non-harmonized province codes.
This function relies on the internal object ref_label, which must contain
the reference tables:
provinceh_label for harmonized codes (province_id_h, label).
province_label for non-harmonized codes (province_id_y, label).