gcdrecode: Recode Austrian "Gemeindecodes"

Description Usage Arguments Details Value Author(s) Examples

Description

Recode Austrian "Gemeindecodes" due to changes over the years (e.g. "Gemeindestrukturreform 2015")

Usage

1
2
3
gcdrecode(year, gcd, targetyear = 2018, invalid = "NA")

gcdrc(year, gcd, targetyear = 2018, ...)

Arguments

year

a character or an integer containing the year

gcd

a vector containing Austrian "Gemeindekennziffern" corresponding to the year

targetyear

a character or an integer containing the year for which the gcd should be returned

invalid

a character or an integer specifying what should be returned for invalid gcd-year-combinations (see details)

...

further arguments in gcdrc passed on gcdrecode

Details

Different states for gcd are available for 2011, 2012, 2013, 2015, 2016, 2017 and 2018 (first of January). All of them, except the first one, are therefore meaningful values for targetyear, which has to be higher than year.

gcdrc is the vectorized version to be used for different values of year. If year is constant in your data, gcdrecode should be used to avoid needless overhead.

There are three possibilities to handle wrong gcd-year-combinations, which can be caused by wrong gcd e.g. if the last two digits are zero (60100):

  1. invalid = "NA" (default): result is set to NA

  2. invalid = "orig": original values of gcd are returned instead of recoding them

  3. invalid = <something else>: something else (character or numeric) is returned

For some gcd there is no unique match possible due to splitting of municipalities in 2015. For these cases the gcd of the part with the higher population (2015) is used and the other is skipped (warning). The numbers in brackets are the gcd belonging to the names of municipalities in 2013 (before splitting) respectively 2015 (after splitting).

Value

a vector containing Austrian "Gemeindecodes" corresponding to the targetyear

Author(s)

Gerhard Nachtmann kpm.nachtmann@gmail.com

Examples

1
2
3
4
5
6
7
8
### 62380 is existing since 2015
gcdrecode(2011, 62380, 2015) # warning
gcdrecode(2011, 62380, 2015, invalid = "orig") # warning
gcdrecode(2011, 62380, 2015, invalid = "wrong") # warning
gcdrecode(2015, 62380, 2017) # didn't change
gcdrc(2011:2012, c(60201, 60201), 2016)
### some gcd of the sequence are not existing --> warning
gcdrc(2016, 32401:32424, 2017) # warning; WU ex 2017

nachti/STATtools documentation built on May 23, 2019, 12:04 p.m.