Got information for holidays and school vacations; put it into CSVs

This commit is contained in:
Nora Wickelmaier 2023-09-15 16:27:08 +02:00
parent 2a2eab4b9f
commit 1f55608ebf

View File

@ -0,0 +1,18 @@
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/data/metadata")
# https://ferien-api.de/#holidaysPerStateAndYear
# Data extracted (on Linux) via:
# curl https://ferien-api.de/api/v1/holidays/NI > schulferien_NI.json
library(jsonlite)
dat <- read_json("schulferien_NI.json", simplify = TRUE)
dat$slug <- NULL
dat$stateCode <- NULL
dat$name <- paste0(gsub("^(.*).niedersachsen.*", "\\1", dat$name),
gsub("^.*niedersachsen [0-9]{4}(.*)", "\\1",
dat$name))
write.table(dat, "schulferien_2019-2025_NI.csv", sep = ";", row.names = FALSE)