validate_geo_code: Validate Conformity with NUTS Geo Codes (vector)

validate_geo_codeR Documentation

Validate Conformity with NUTS Geo Codes (vector)

Description

Validate that geo is conforming with the NUTS1, NUTS2, or NUTS3 typologies.

Usage

validate_geo_code(geo, nuts_year = 2016)

Arguments

geo

A vector of geographical code to validate.

nuts_year

A valid NUTS edition year.

Details

While country codes are technically not part of the NUTS typologies, Eurostat de facto uses a NUTS0 typology to identify countries. This de facto typology has three exception which are handled by the validate_nuts_countries function.

NUTS typologies have different versions, therefore the conformity is validated with one specific versions, which can be any of these: 1999, 2003, 2006, 2010, 2013, the currently used 2016 and the already announced and defined 2021.

The NUTS typology was codified with the NUTS2003, and the pre-1999 NUTS typologies may confuse programmatic data processing, given that some NUTS1 regions were identified with country codes in smaller countries that had no NUTS1 divisions.

#' Currently the 2016 is used by Eurostat, but many datasets still contain 2013 and sometimes earlier metadata.

Value

A character list with the valid typology, or 'invalid' in the cases when the geo coding is not valid.

Examples


my_reg_data <- data.frame (
  geo = c("BE1", "HU102", "FR1",
          "DED", "FR7", "TR", "DED2",
          "EL", "XK", "GB"),
  values = runif(10))

validate_geo_code(my_reg_data$geo)


antaldaniel/regions documentation built on Sept. 27, 2022, 1:15 a.m.