Learn R Programming

klassR (version 1.0.2)

Classifications and Codelists for Statistics Norway

Description

Functions to search, retrieve, apply and update classifications and codelists using Statistics Norway's API from the system 'KLASS'. Retrieves classifications by date with options to choose language, hierarchical level and formatting.

Copy Link

Version

Install

install.packages('klassR')

Monthly Downloads

260

Version

1.0.2

License

MIT + file LICENSE

Maintainer

Susie Jentoft

Last Published

February 7th, 2025

Functions in klassR (1.0.2)

klass_131_graph

Test Graph data for municipalities in 2024
update_code

Update a code found in a directed graph based on a Klass-classification
update_klass

Update multiple Klass codes to a desired date.
get_variant_name

Get variant name Internal function for fetching the variant name based on the number
get_name

Get the name of a classification version
klass_node

Given a Klass graph, find the node corresponding to a code and (optionally) a date.
klass_graph

Build a directed graph of code changes based on a Klass classification
get_family

Identify corresponding family from a classification number
stop_quietly

Stop quietly function Stop from a function without an error. Used for stopping when no internet
update_klass_node

Given a node and a graph, find the node at the end of a sequence of changes.
get_klass

Fetch Statistics Norway classification data using API
search_klass

Search Klass
correspond_list

Correspondence list Print a list of correspondence tables for a given classification with source and target IDs
klass_131_1964_graph

Test Graph data for municipalities in 1964
list_family

Classification family list Print a list of all families and the number of classifications in each
list_klass

Classification list Get a full list of all classifications and codelists
check_connect

Check connection Function to check that a connection to data.ssb.no is able to be established
is_split

Given a graph and a node, determine if the node is a split code.
klassdata

Testdata for klassR package
get_version

Get version number of a class given a date
levelCheck

Check which level the input data/vector is
is_combined

Given a graph and a node, determine if the node is a result of combinations of multiple codes.
MakeUrl

Internal function to create URL address
apply_klass

Match and convert a classification
find_variant_from

Find the variant of a code corresponding to a change *from* a specific code.
GetBaseUrl

Get base address for fetching classifications from
GetUrl2

Get json file from Url - alternative version
ConvertTable

Code level convert table (internal function)
formattering

Format vector for industry codes
GetUrl

Get json file from Url
find_variant_to

Find the variant of a code corresponding to a change *to* a specific code.
GetNums

Get target ID numbers from Url
MakeChar

Conversion to character
CheckDate

Internal function to check date
Levels

Title
count_neighbors

Count the neighbors of a node.
find_dates

For a given Klass code, produce a table of dates describing the valid-from and valid-to dates of all versions of the code
find_name

Find the name of a code valid at a specific date.
klass_131_2020_graph

Test Graph data for municipalities in 2020
formattering_kommune

Format vector for kommune codes
formattering_nace

Format vector for industry codes