code_bundesland {ags} | R Documentation |
Convert the Name or the AGS of a Bundesland
Description
Convert the Name or the AGS of a Bundesland
Usage
code_bundesland(
sourcevar,
origin = "ags",
destination = "name",
factor = FALSE
)
Arguments
sourcevar |
Vector which contains the codes or names to be converted. |
origin |
The following options are available:
|
destination |
The following options are available:
|
factor |
If |
Details
This function converts a string of Bundesland names into the AGS, the standardized (English) name, or the Bundesland abbreviation.
If origin="AGS"
, the first two digits will be used to identify
a Bundesland. It is therefore important that sourcevar
is supplied
as a character vector with a leading zeros if applicable.
Value
A character vector.
See Also
format_ags()
for formatting AGS.
Examples
library(dplyr)
data(btw_sn)
btw_sn %>%
mutate(bl=code_bundesland(district, origin="ags",
destination="name"))