Skip to content

Instantly share code, notes, and snippets.

@USMortality
Created January 28, 2025 17:02
Show Gist options
  • Save USMortality/723d6ec0c133c78b919208d65471634f to your computer and use it in GitHub Desktop.
Save USMortality/723d6ec0c133c78b919208d65471634f to your computer and use it in GitHub Desktop.
Data: Deutschland ARE/ILI
library(readr)
library(dplyr)
library(tidyr)
df <- read_tsv(
paste0(
"https://raw.githubusercontent.com/robert-koch-institut/",
"GrippeWeb_Daten_des_Wochenberichts/main/",
"GrippeWeb_Daten_des_Wochenberichts.tsv"
)
) |>
filter(
Erkrankung %in% c("ARE", "ILI"),
Altersgruppe == "00+",
Region == "Bundesweit"
) |>
mutate(
Saison = Saison,
Jahr = as.integer(substr(Kalenderwoche, 1, 4)),
Woche = as.integer(substr(Kalenderwoche, 7, 8)),
Typ = Erkrankung,
Inzidenz = as.integer(Inzidenz)
) |>
select(Jahr, Woche, Saison, Typ, Inzidenz) |>
pivot_wider(names_from = Typ, values_from = Inzidenz)
write.csv(df, "deutschland_are_ili.csv", row.names = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment