noegletal_tidy {noegletalR}R Documentation

Transform a csv file from noegletal.dk into a tidy tibble

Description

noegletal_tidy takes as input a csv-file downloaded from noegletal.dk and parses it into a tidy tibble::tibble(). This tibble::tibble() has one row for each municipality-year, a muni_code column, a year column and a column for each variable (as selected on noegletal.dk).

As per the noegletal.dk documentation, cells with a dash - as a value is converted to a 0, while cells with a value of M or U is converted to NA, since these represent missing values.

Usage

noegletal_tidy(file)

Arguments

file

Path to a csv file downloaded from noegletal.dk.

Value

A tidy tibble::tibble() with one row for each municipality-year, and one column for each included variable (nøgletal).

Examples

path_to_file <- system.file("extdata",
                            "nwRap-10Sep2024-101803.csv",
                            package = "noegletalR",
                            mustWork = TRUE)
noegletal_tidy(file = path_to_file)

[Package noegletalR version 0.2.1 Index]