-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.Rhistory
85 lines (85 loc) · 3.31 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
install.packages("meta")
install.packages(c("dplyr","ggplot2"))
source('~/Dropbox/HZI/HEV/Example_of_the_analysis/Isti.R')
source("~/Documents/GitHub/covid-schulen/R/kmk_cleaning.R", echo=TRUE)
setwd("~/Documents/GitHub/covid-schulen")
source("~/Documents/GitHub/covid-schulen/R/kmk_cleaning.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/kmk_cleaning.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/gen_verlauf_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_quara.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/run_county_render.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/forecast.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/gen_verlauf_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_quara.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/run_county_render.R", echo=TRUE)
library(flexdashboard)
library(dplyr)
library(ggplot2)
library(lubridate)
library(emojifont)
library(leaflet)
library(readr)
library(tidyr)
library(stringr)
library(forcats)
load("leaflet_maps/recent_maps_bl.RData")
load("leaflet_maps/gall_bl.RData")
load("leaflet_maps/recent_maps_bl_quara.RData")
load("data_clean/current_tabs.RData")
load("leaflet_maps/forecast.RData")
# per country data
df_long <- list.files("data_clean/", pattern = "_clean_kpi_bl.rds", full.names = TRUE) %>%
as_tibble() %>%
mutate(datum = str_extract(value, "[0-9]{8}"),
datum = ymd(datum)) %>%
arrange(desc(datum)) %>%
pull(value) %>%
.[1] %>%
readRDS()
# clean kpi data
recent_kmkdata_file <- list.files("data_clean/", pattern = "kmkdata.rds", full.names = TRUE) %>%
as_tibble() %>%
mutate(datum = str_extract(value, "[0-9]{8}"),
datum = ymd(datum)) %>%
arrange(desc(datum)) %>%
pull(value) %>%
.[1] %>%
readRDS()
kmk_students_bl
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/gen_verlauf_bl.R", echo=TRUE)
kmk_students_bl
plot_verlauf <- function(cat) {
plot_data <- df_long %>%
filter(category == cat,
data_date > ymd(20210101)) %>%
mutate(
woche = week(data_date),
woche = ifelse(nchar(woche) == 1, paste0("0", woche), woche),
jahr = year(data_date),
kw = paste0(jahr, "-", woche)
) %>%
group_by(kw) %>%
summarise(total = sum(value, na.rm = TRUE))
xticks <- sort(plot_data$kw)
plot_data %>%
ggplot(aes(kw, total, group = 1)) +
geom_col(fill = "#152238") +
ggplot2::theme_light() +
theme(text = element_text(size = 40),
axis.text.x = element_text(angle = 45, vjust = 0.5, hjust = 0.5)) +
scale_x_discrete(breaks = xticks[seq(1, length(xticks), 7)]) +
labs(x = "Kalenderwoche", y = "Total infiziert")
}
plot_verlauf("students_infected")
kmk_students_bl
source("~/Documents/GitHub/covid-schulen/R/kmk_cleaning.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/gen_verlauf_bl.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/leaflet_quara.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/run_county_render.R", echo=TRUE)
source("~/Documents/GitHub/covid-schulen/R/forecast.R", echo=TRUE)