klassR (version 0.1.2)

GetKlass: Fetch classification data Fetch Statistics Norway classification data using API

Description

Fetch classification data Fetch Statistics Norway classification data using API

Usage

GetKlass(klass, date = NULL, correspond = NULL, output_level = NULL,
  language = "nb", output_style = "normal")

Arguments

klass

Number/string of the classification ID/number. (use Klass_list() to find this)

date

String for the required date of the classification. Format must be "yyyy-mm-dd". For an inverval, provide two dates as a vector. If blank, will default to today's date.

correspond

Number/string of the target correspondence (if a correspondence table is requested).

output_level

Number/string specifying the requested heirachy level (optional).

language

Two letter string for the requested language output. Default is bokm<U+00E5>l ("nb"). Nynorsk ("nn") and English ("en") also available for some classificatio.)

output_style

String varibale for the output type. Default is "normal" and only option currently prorammed

Value

The function returns a data frame of the specified classification/correspondence table. Output variables include: code, parentCode, level, and name for standard lists. For correspondence tables variables include: sourceCode, sourceName, targetCode and targetName. For time correspondence tables variables include: oldCode, oldName, newCode and newName.

Examples

Run this code
# NOT RUN {
# Get classification for occupation classifications
head(GetKlass(klass = "7"))
# Get classification for occupation classifications in English
head(GetKlass(klass = "7", language = "en"))
# Get classifications for level 2 only
head(GetKlass(klass = "7", output_level = 2))
# Get classifications for level 2 only valid on a specified date of between two dates
head(GetKlass(klass = "7", output_level = 2, date = "2007-01-01"))
head(GetKlass(klass = "7", date = c("2007-01-01", "2018-01-01")))
# }
# NOT RUN {
# Get correspondence table between two occupation classifications
GetKlass(klass = "145", correspond = "7", date = "2018-01-01")
#Get correspondence table between two dates for municipality
GetKlass(klass = "131", correspond = TRUE, date = c("2015-01-01", "2019-01-01"))
# }

Run the code above in your browser using DataLab