Learn R Programming

klassR (version 1.0.4)

Classifications for Statistics Norway

Description

Functions to search, retrieve, apply and update classification standards and code lists 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

238

Version

1.0.4

License

MIT + file LICENSE

Maintainer

Susie Jentoft

Last Published

December 12th, 2025

Functions in klassR (1.0.4)

klassdata

Testdata for klassR package
klass_graph

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

Identify corresponding family from a classification number
GetUrl2

Get json file from Url - alternative version
stop_quietly

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

Search Klass
get_klass

Fetch Statistics Norway classification data using API
klass_node

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

Code level convert table (internal function)
formattering

Format vector for industry codes
formattering_kommune

Format vector for kommune codes
find_variant_to

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

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

Format vector for industry codes
GetUrl

Get json file from Url
klass_131_graph

Test Graph data for municipalities in 2024
update_klass_node

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

Test Graph data for municipalities in 2020
levelCheck

Check which level the input data/vector is
get_name

Get the name of a classification version
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.
correspond_list

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

Internal function to check date
apply_klass

Match and convert a classification
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
check_connect

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

Count the neighbors of a node.
find_name

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

Get target ID numbers from Url
Levels

Title
find_variant_from

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

Conversion to character
get_version

Get version number of a class given a date
MakeUrl

Internal function to create URL address
GetBaseUrl

Get base address for fetching classifications from
is_split

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

Test Graph data for municipalities in 1964
is_combined

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

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

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