forked from favstats/meta_reports2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave.R
55 lines (41 loc) · 1.23 KB
/
save.R
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
source("use.R")
# install.packages("pacman")
pacman::p_load(
janitor,
tidyr,
dplyr,
stringr,
lubridate,
purrr,
glue,
ggplot2
)
# daily_dat <- readRDS("data/daily.rds")
old_dat <- dir("daily", full.names = T) %>%
keep(~str_detect(.x, "rds")) %>%
map_dfr_progress(readRDS)
old_dat %>%
mutate(date_produced = lubridate::ymd(date)) %>%
drop_na(date_produced) %>%
janitor::clean_names() %>%
distinct(cntry, date_produced, .keep_all = T) %>%
count(date_produced) %>%
ggplot(aes(date_produced, n)) +
geom_col() +
theme_minimal() +
labs(y = "How many Countries", x = "For each date", title = paste0("Daily Reports: ", Sys.time()))
ggsave("overview.png", width = 8, height = 5)
old_dat <- dir("lifelong", full.names = T) %>%
keep(~str_detect(.x, "rds")) %>%
map_dfr_progress(readRDS)
old_dat %>%
mutate(date_produced = lubridate::ymd(date)) %>%
drop_na(date_produced) %>%
janitor::clean_names() %>%
distinct(cntry, date_produced, .keep_all = T) %>%
count(date_produced) %>%
ggplot(aes(date_produced, n)) +
geom_col() +
theme_minimal() +
labs(y = "How many Countries", x = "For each date", title = paste0("Lifelong Reports: ", Sys.time()))
ggsave("overview_ll.png", width = 8, height = 5)