Skip to contents

Function to convert region names to region codes. The names must exactly match an entry of the name column in one of the conversion tables in order to find a matching code.

Usage

region_codes(x, prefer = c("nuts", "iso"))

Arguments

x

a character vector containing region names

prefer

in case of nuts2 regions, this parameter determines if the nuts2 or the iso representation is returned

Examples

region_codes("Burgenland")
#> [1] "AT11"
region_codes("Burgenland", prefer = "iso")
#> [1] "1"