Skip to content

Commit

Permalink
differences for PR #151
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 6, 2025
1 parent 26e5865 commit 61d47f7
Show file tree
Hide file tree
Showing 6 changed files with 6,258 additions and 0 deletions.
86 changes: 86 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#------------------------------------------------------------
# Values for this lesson.
#------------------------------------------------------------

# Which carpentry is this (swc, dc, lc, or cp)?
# swc: Software Carpentry
# dc: Data Carpentry
# lc: Library Carpentry
# cp: Carpentries (to use for instructor training for instance)
# incubator: The Carpentries Incubator
carpentry: 'epiverse-trace'

# Overall title for pages.
title: 'Real-time analysis and forecasting for outbreak analytics with R'

# Date the lesson was created (YYYY-MM-DD, this is empty by default)
created:

# Comma-separated list of keywords for the lesson
keywords: 'forecasts, epidemic models, interventions'

# Life cycle stage of the lesson
# possible values: pre-alpha, alpha, beta, stable
life_cycle: 'pre-alpha'

# License of the lesson materials (recommended CC-BY 4.0)
license: 'CC-BY 4.0'

# Link to the source repository for this lesson
source: 'https://github.com/epiverse-trace/tutorials-middle'

# Default branch of your lesson
branch: 'main'

# Who to contact if there are any issues
contact: '[email protected]'

# Navigation ------------------------------------------------
#
# Use the following menu items to specify the order of
# individual pages in each dropdown section. Leave blank to
# include all pages in the folder.
#
# Example -------------
#
# episodes:
# - introduction.md
# - first-steps.md
#
# learners:
# - setup.md
#
# instructors:
# - instructor-notes.md
#
# profiles:
# - one-learner.md
# - another-learner.md

# Order of episodes in your lesson
episodes:
- delays-access.Rmd
- quantify-transmissibility.Rmd
- delays-functions.Rmd
- create-forecast.Rmd
- severity-static.Rmd
- superspreading-estimate.Rmd
- superspreading-simulate.Rmd

# Information for Learners
learners:

# Information for Instructors
instructors:

# Learner Profiles
profiles:

# Customisation ---------------------------------------------
#
# This space below is where custom yaml items (e.g. pinning
# sandpaper and varnish versions) should live


varnish: epiverse-trace/varnish@epiversetheme
sandpaper: epiverse-trace/sandpaper@patch-renv-github-bug
49 changes: 49 additions & 0 deletions data-covid-filter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

library(tidyverse)
library(incidence2)

# read data ---------------------------------------------------------------

incidence_class <- incidence2::covidregionaldataUK %>%
as_tibble() %>%
filter(region == "London") %>%
# preprocess missing values
tidyr::replace_na(
list(
deaths_new = 0,
cases_new = 0
)
) %>%
# compute the daily incidence
incidence2::incidence(
date_index = "date",
counts = c("cases_new","deaths_new"),
date_names_to = "date",
complete_dates = TRUE
) %>%
identity()


incidence_class %>%
# filter(date < ymd(20200415)) %>%
# filter(date < ymd(20200701)) %>%
plot()

covid_incidence2 <- incidence_class %>%
cfr::prepare_data(
cases_variable = "cases_new",
deaths_variable = "deaths_new") %>%
as_tibble()

covid_incidence2

covid_incidence2 %>%
write_rds(file.path("episodes", "data", "covid_490days.rds"))

covid_incidence2 %>%
filter(date < ymd(20200415)) %>%
write_rds(file.path("episodes", "data", "covid_150days.rds"))

covid_incidence2 %>%
filter(date < ymd(20200701)) %>%
write_rds(file.path("episodes", "data", "covid_300days.rds"))
Binary file added data/covid_150days.rds
Binary file not shown.
Binary file added data/covid_300days.rds
Binary file not shown.
Binary file added data/covid_490days.rds
Binary file not shown.
Loading

0 comments on commit 61d47f7

Please sign in to comment.