Skip to content

Commit 481699b

Browse files
committed
site deploy
Auto-generated via `{sandpaper}` Source : ec7fc0f Branch : md-outputs Author : GitHub Actions <[email protected]> Time : 2025-03-06 15:55:21 +0000 Message : markdown source builds Auto-generated via `{sandpaper}` Source : b47bb03 Branch : main Author : Andree Valle Campos <[email protected]> Time : 2025-03-06 15:52:32 +0000 Message : add covid data generation file
1 parent 22b9910 commit 481699b

40 files changed

+232
-153
lines changed

404.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CODE_OF_CONDUCT.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aio.html

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-forecast.html

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data-covid-filter.R

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
library(tidyverse)
3+
library(incidence2)
4+
5+
# read data ---------------------------------------------------------------
6+
7+
incidence_class <- incidence2::covidregionaldataUK %>%
8+
as_tibble() %>%
9+
filter(region == "London") %>%
10+
# preprocess missing values
11+
tidyr::replace_na(
12+
list(
13+
deaths_new = 0,
14+
cases_new = 0
15+
)
16+
) %>%
17+
# compute the daily incidence
18+
incidence2::incidence(
19+
date_index = "date",
20+
counts = c("cases_new","deaths_new"),
21+
date_names_to = "date",
22+
complete_dates = TRUE
23+
) %>%
24+
identity()
25+
26+
# number of dates ---------------------------------------------------------
27+
28+
incidence_class %>%
29+
count(date) %>%
30+
nrow()
31+
32+
incidence_class %>%
33+
filter(date < ymd(20200415)) %>%
34+
count(date) %>%
35+
nrow()
36+
37+
incidence_class %>%
38+
filter(date < ymd(20200701)) %>%
39+
count(date) %>%
40+
nrow()
41+
42+
# plot incidence ----------------------------------------------------------
43+
44+
incidence_class %>%
45+
plot()
46+
47+
incidence_class %>%
48+
filter(date < ymd(20200415)) %>%
49+
plot()
50+
51+
incidence_class %>%
52+
filter(date < ymd(20200701)) %>%
53+
plot()
54+
55+
# adapt for cfr -----------------------------------------------------------
56+
57+
covid_incidence2 <- incidence_class %>%
58+
cfr::prepare_data(
59+
cases_variable = "cases_new",
60+
deaths_variable = "deaths_new") %>%
61+
as_tibble()
62+
63+
covid_incidence2
64+
65+
66+
# write data --------------------------------------------------------------
67+
68+
covid_incidence2 %>%
69+
filter(date < ymd(20200415)) %>%
70+
write_rds(file.path("episodes", "data", "covid_70days.rds"))
71+
72+
covid_incidence2 %>%
73+
filter(date < ymd(20200701)) %>%
74+
write_rds(file.path("episodes", "data", "covid_150days.rds"))
75+
76+
covid_incidence2 %>%
77+
write_rds(file.path("episodes", "data", "covid_490days.rds"))

data/covid_150days.rds

3.84 KB
Binary file not shown.

data/covid_490days.rds

11.7 KB
Binary file not shown.

data/covid_70days.rds

2.04 KB
Binary file not shown.

delays-access.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

delays-functions.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

images.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

instructor-notes.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

instructor/404.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

instructor/CODE_OF_CONDUCT.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

instructor/LICENSE.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)