This function will get the corresponding geo code of specific granularity via
API from SSB whenever available.
Usage
get_correspond(
type = c("fylke", "okonomisk", "kommune", "bydel", "levekaar"),
correspond = c("fylke", "kommune", "bydel", "grunnkrets"),
from = NULL,
to = NULL,
dt = TRUE,
names = TRUE
)
Arguments
- type
Higher granularity from specified correspond arg.
- correspond
Lower granularity from the specified type arg.
- 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.
- dt
Output as data.table
- names
Include names. Default is TRUE
Value
A dataset of class data.table
representing the lower geographical
level codes and their corresponding higher geographical levels. For example
for codes on enumeration areas and their corresponding codes for
municipalities or town.
Examples
df <- get_correspond("kommune", "grunnkrets", 2019)