This commit is contained in:
Fabian Valka 2020-04-10 19:49:27 +02:00
Родитель 4891771d15
Коммит 82a68c1726
1 изменённых файлов: 3 добавлений и 19 удалений

Просмотреть файл

@ -1,21 +1,5 @@
library(jsonlite)
d=readRDS('data/COVID-19-up-to-date.rds')
countries <- c(
"Denmark",
"Italy",
"Germany",
"Spain",
"United_Kingdom",
"France",
"Norway",
"Belgium",
"Austria",
"Sweden",
"Switzerland",
"Greece",
"Portugal",
"Netherlands"
)
verify_web_output <- function(){
plot_names <- c("deaths", "forecast", "infections", "rt")
plot_versions <- c("mobile", "desktop")
@ -31,14 +15,14 @@ verify_web_output <- function(){
for (plot_version in plot_versions) {
for (plot_name in plot_names) {
path = sprintf("web/figures/%s/%s_%s.svg", plot_version, country, plot_name)
if (! file.exists(path)) {
stop(sprintf("Missing web output during verification: %s", path))
}
}
}
d1=d[d$Countries.and.territories==country,]
d1=d[d$Countries.and.territories==Country,]
d1$date = as.Date(d1$DateRep,format='%d/%m/%Y')
latest_date = max(d1$date)
date_results[[country]] = latest_date