Created
May 17, 2020 16:31
-
-
Save dspm/4a4cc5236c3f925406c81d071621d514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(jsonlite) | |
set.seed(666) | |
data <- | |
"https://www.koronavirus.hr/json/?action=po_osobama" %>% | |
fromJSON() %>% | |
as_tibble() %>% | |
transmute(report = as.Date(Datum)) %>% | |
mutate( | |
test_delay = rgamma(n(), 2, 2), | |
exam_delay = rgamma(n(), 3, 2), | |
onset_delay = rgamma(n(), 3, .4), | |
infection_delay = rlnorm(n(), log(6), log(1.5)), | |
total_delay = infection_delay + onset_delay + exam_delay + test_delay, | |
infection = report - floor(total_delay) | |
) %>% | |
select(report, infection, total_delay, everything()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment