View source: R/code_bundesland.R
code_bundesland | R Documentation |
Convert the Name or the AGS of a Bundesland
code_bundesland(
sourcevar,
origin = "ags",
destination = "name",
factor = FALSE
)
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 |
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.
A character vector.
format_ags()
for formatting AGS.
library(dplyr)
data(btw_sn)
btw_sn %>%
mutate(bl=code_bundesland(district, origin="ags",
destination="name"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.