Learn R Programming

klassR (version 0.1.2)

ApplyKlass: Match and convert a classification

Description

Match and convert a classification

Usage

ApplyKlass(x, klass, date = NULL, correspond = NULL, language = "nb",
  output_level = NULL, output = "name", format = TRUE)

Arguments

x

Input vector

klass

Classification number

date

Date for classification (format = "YYYY-mm-dd"). Default is current date

correspond

ID number for target in correspondence table. For correspondence between two dates within the same classification, use correspond = TRUE.

language

Default "nb" for Norwegian (Bokm<U+00E5>l). Also "nn" (Nynorsk) and "en" (English available for some classifications)

output_level

Desired output level

output

String describing output. May be "name" (default), "code" or "both".

format

Logical for whther to run formatting av input vector x (Default = TRUE), important to check if formatting is in one level.

Value

A vector or data frame is returned with names and/or code of the desired output level.

Examples

Run this code
# NOT RUN {
data(klassdata)
klassdata$kommune_names <- ApplyKlass(x = klassdata$kommune, klass = 131, format=FALSE)
klassdata$name <- ApplyKlass(x = klassdata$nace5, klass = 6, language = "en", format=FALSE)
klassdata$name2 <- ApplyKlass(x = klassdata$nace5, klass = 6, date = "2015-01-01", format=FALSE)
# }

Run the code above in your browser using DataLab