powered by
This function will download the codes of selected geographical levels via API.
get_code( type = c("fylke", "kommune", "bydel", "grunnkrets"), from = NULL, to = NULL, date = FALSE, names = TRUE )
A dataset of class data.table consisting codes of selected geographical level and the duration the codes are valid ie. from and to.
data.table
Type of regional granularity ie. fylke, kommune etc.
Specify the starting year for range period. Current year is the default.
Specify the year to end the range period. Current year is used when not specified.
Give complete date if TRUE else year only. Default it FALSE
Include names. Default is TRUE
if (FALSE) { mydata <- get_code("kommune", from = 2017, to = 2020) }
Run the code above in your browser using DataLab