Eurostat mixes NUTS2013 and NUTS2016 geographic label codes in the 'geo' column, which creates time-wise comparativity issues. This function recodes the observations where only the coding changed, and marks discontinued regions, and other regions which may or may not be somehow compared to the historic 'NUTS2013' boundaries.

recode_to_nuts_2013(dat)

Arguments

dat

A Eurostat data frame downloaded with get_eurostat.

Value

An augmented and potentially relabelled data frame which contains all formerly 'NUTS2013' definition geo labels in the 'NUTS2016' vocabulary when only the code changed, but the boundary did not. It also contains some information on other geo labels that cannot be brought to the current 'NUTS2013' definition. Furthermore, when the official name of the region changed, it will use the new name (if the otherwise the region boundary did not change.) If not called before, the function will use the helper function harmonize_geo_code

Author

Daniel Antal

Examples

test_regional_codes <- data.frame ( geo = c("FRB", "FRE", "UKN02", "IE022", "FR243", "FRB03"), time = c(rep(as.Date ("2014-01-01"), 5), as.Date("2015-01-01")), values = c(1:6), control = c("Changed from NUTS2 to NUTS1", "New region NUTS2016 only", "Discontinued region NUTS2013", "Boundary shift NUTS2013", "Recoded in NUTS2013", "Recoded in NUTS2016" )) recode_to_nuts_2013(test_regional_codes)
#> In this data frame 3 observations are coded with the current NUTS2016 #> geo labels and 3 observations/rows have NUTS2013 historical labels.
#> Warning: The following regions have no NUTS2013 geo labels: FRB, FRE.
#> geo time values code13 code16 name #> 1 FR243 2014-01-01 5 FR243 FRB03 Indre #> 2 IE022 2014-01-01 4 IE022 IE062 Mid-East #> 3 UKN02 2014-01-01 3 UKN02 <NA> Outer Belfast #> 4 <NA> 2014-01-01 1 <NA> FRB CENTRE — VAL DE LOIRE #> 5 <NA> 2014-01-01 2 <NA> FRE NORD-PAS DE CALAIS-PICARDIE #> 6 FR243 2015-01-01 6 FR243 FRB03 Indre #> control nuts_level #> 1 Recoded in NUTS2013 2 #> 2 Boundary shift NUTS2013 2 #> 3 Discontinued region NUTS2013 2 #> 4 Changed from NUTS2 to NUTS1 1 #> 5 New region NUTS2016 only 1 #> 6 Recoded in NUTS2016 2 #> change resolution #> 1 recoded FRB03=FR243 #> 2 boundary shift <NA> #> 3 discontinued <NA> #> 4 new NUTS 1 region, identical to ex-NUTS 2 region FR24 FRB=FR24 #> 5 new NUTS 1 region, merge of ex-NUTS 2 regions FR22 and FR30 FRE=FR22+FR30 #> 6 recoded FRB03=FR243 #> nuts_2016 nuts_2013 #> 1 FALSE TRUE #> 2 FALSE TRUE #> 3 FALSE TRUE #> 4 TRUE FALSE #> 5 TRUE FALSE #> 6 TRUE FALSE