Package 'vietnamcode'

Title: Convert Vietnam Provincial Codes
Description: Converts Vietnam's provinces' names and ID across different formats. Handles diacritics and different spellings.
Authors: Anh Le [aut, cre]
Maintainer: Anh Le <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2024-12-01 08:50:08 UTC
Source: CRAN

Help Index


Convert Vietnam provincial ID

Description

Converts Vietnam's provinces' names and ID across different formats. Handles diacritics and different spellings.

Usage

vietnamcode(sourcevar, origin = c("province_name", "enterprise_census",
  "enterprise_census_old", "enterprise_census_c", "pci"),
  destination = c("province_name", "province_name_diacritics",
  "enterprise_census", "enterprise_census_old", "enterprise_census_c", "pci"))

Arguments

sourcevar

Character vector that contains the codes or province names to be converted

origin

String that indicates the coding scheme of origin

destination

String that indicates the coding scheme of destination

Note

Supports the following coding schemes:

  • province_name

  • province_name_diacritics

  • enterprise_censusm enterprise_census_old, enterprise_census_c: the same as GSO code

  • pci: Provincial Competitiveness Index

Examples

codes.of.origin <- vietnamcode::vietnamcode_data$province_name # Vector of values to be converted
vietnamcode(codes.of.origin, "province_name", "pci")

Vietnam provinces ID

Description

Vietnam provinces ID

Usage

vietnamcode_data

Format

A data frame

  • province_nameprovince name

  • province_nameprovince name with diacritics

  • pciused by the Provincial Competitiveness Index

  • enterprise_censusused by the General Statistics Office (GSO) for the Enterprise Census

  • enterprise_census_oldold GSO code

  • enterprise_census_cGSO code as character

  • regexRegular Expression to match different spellings