Learn R Programming

censuspyrID (version 1.0.2)

reg_name: Get Province Name from Code

Description

Internal helper function to retrieve the province name corresponding to a given province code. Works with either harmonized or non-harmonized codes.

Usage

reg_name(code, harmonized = TRUE)

Value

A character string with the corresponding province name.

Arguments

code

Integer or character. The province code to look up.

harmonized

Logical. If TRUE (default), the function searches using harmonized province codes. If FALSE, it uses non-harmonized province codes.

Details

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).