get_kanton: Get the name, label or number of the canton from the...

Description Usage Arguments Details Value Examples

Description

Get the name, label or number of the canton from the Gemeindenummer

Usage

1
get_kanton(x, render = "label", bfs = TRUE)

Arguments

x

a vector of codes to be converted

render

Return label (default), the name or the number?

bfs

x is the Gemeindenummer (default) or the canton number?

Details

Each canton uses certain ranges of the Gemeindenummer (GEOSTAT-Nr. or BFS-Nr.) which runs from 1 to 6806. This function converts Gemeindenummern either to the name of the canton (if render="name"), the two-character label (render="label") or the canton number (render="number").

x can either be the 1-4 digit Gemeindenummer (set bfs=TRUE) or the 1-2 digits canton number (bfs=FALSE). If x is not a numeric vector, it is coerced to one.

Value

a character vector of names/labels or a numeric vector.

Examples

1
2
3
4
5
6
7
 ## Not run: 
 
	 get_kanton( c("4951") )
  get_kanton( c("02", "3"), bfs=TRUE )

 
## End(Not run)

sumtxt/neuchatel documentation built on May 19, 2019, 1:47 a.m.