Got information for holidays and school vacations; put it into CSVs
This commit is contained in:
parent
2a2eab4b9f
commit
1f55608ebf
18
code/schulferien_json-to-dataframe.R
Normal file
18
code/schulferien_json-to-dataframe.R
Normal 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)
|
||||
|
Loading…
Reference in New Issue
Block a user