A function for retrieving topic keys used to label various data from the Norwegian parliament.
Value
A list with two elements:
$topics (All topics)
response_date Date of data retrieval version Data version from the API is_main_topic Logical indicator for whether the topic is a main topic main_topic_id Id of main topic id Id of topic name Name of topic $main_topics (exclusively main topics, if keep_sub_topics = TRUE)
response_date Date of data retrieval version Data version from the API is_main_topic Logical indicator for whether the topic is a main topic main_topic_id Id of main topic id Id of topic name Name of topic
Examples
# Request the data
tops <- get_topics()
# Look at the first main topic
tops$main_topics[1, ]
#> response_date version is_main_topic main_topic_id id
#> 1 2024-11-15T01:00:18.9039847+01:00 1.6 true 4 4
#> name
#> 1 Energi
# Extract all sub-topics for the first main topic
tops$topics[which(tops$topics$main_topic_id == 5), ]
#> response_date version is_main_topic main_topic_id id
#> 127 2024-11-15T01:00:18.9039847+01:00 1.6 false 5 95
#> 128 2024-11-15T01:00:18.9039847+01:00 1.6 false 5 7
#> 129 2024-11-15T01:00:18.9039847+01:00 1.6 false 5 94
#> 130 2024-11-15T01:00:18.9039847+01:00 1.6 false 5 205
#> name
#> 127 Lønn og inntekt
#> 128 Sysselsetting
#> 129 Arbeidsvilkår
#> 130 Arbeidsmiljø