Skip to contents

This function will download the codes of selected geographical levels via API.

Usage

get_code(
  type = c("fylke", "kommune", "bydel", "grunnkrets"),
  from = NULL,
  to = NULL,
  date = FALSE,
  names = TRUE
)

Arguments

type

Type of regional granularity ie. fylke, kommune etc.

from

Specify the starting year for range period. Current year is the default.

to

Specify the year to end the range period. Current year is used when not specified.

date

Give complete date if TRUE else year only. Default it FALSE

names

Include names. Default is TRUE

Value

A dataset of class data.table consisting codes of selected geographical level and the duration the codes are valid ie. from and to.

Examples

mydata <- get_code("kommune", from = 2017, to = 2019)