Skip to content

fix: manually do smoothing in jhu_csse_daily_subset, regenerate #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
* regenerated the `jhu_csse_daily_subset` dataset with the latest versions of
the data from the API
* changed approach to versioning, see DEVELOPMENT.md for details

# epiprocess 0.7.1.9999
* `select` on grouped `epi_df`s now only drops `epi_df`ness if it makes sense; PR #390
* Minor documentation updates; PR #393

## Breaking changes

* Switched `epi_df`'s `other_keys` default from `NULL` to `character(0)`; PR #390

## Improvements

* `select` on grouped `epi_df`s now only drops `epi_df`ness if it makes sense; PR #390
* Minor documentation updates; PR #393

# epiprocess 0.7.0

## Improvements
Expand Down
18 changes: 9 additions & 9 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
#' in Engineering. Copyright Johns Hopkins University 2020.
#'
#' Modifications:
#' * \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{From the COVIDcast Epidata API}:
#' These signals are taken directly from the JHU CSSE
#' \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 GitHub repository}
#' without changes. The 7-day average signals are computed by Delphi by
#' calculating moving averages of the preceding 7 days, so the signal for
#' June 7 is the average of the underlying data for June 1 through 7,
#' inclusive.
#' * Furthermore, the data has been limited to a very small number of rows,
#' the signal names slightly altered, and formatted into a tibble.
#' * \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{From
#' the COVIDcast Epidata API}: The case signal is taken directly from the JHU
#' CSSE \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 GitHub
#' repository}. The rate signals were computed by Delphi using Census
#' population data. The 7-day average signals were computed by Delphi by
#' calculating moving averages of the preceding 7 days, so the signal for June
#' 7 is the average of the underlying data for June 1 through 7, inclusive.
#' * Furthermore, the data has been limited to a very small number of rows, the
#' signal names slightly altered, and formatted into a tibble.
"jhu_csse_daily_subset"


Expand Down
32 changes: 16 additions & 16 deletions data-raw/jhu_csse_daily_subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,58 @@ library(epidatr)
library(epiprocess)
library(dplyr)

confirmed_7dav_incidence_prop <- pub_covidcast(
confirmed_incidence_num <- pub_covidcast(
source = "jhu-csse",
signals = "confirmed_7dav_incidence_prop",
signals = "confirmed_incidence_num",
geo_type = "state",
time_type = "day",
geo_values = "ca,fl,ny,tx,ga,pa",
time_values = epirange(20200301, 20211231),
) %>%
select(geo_value, time_value, case_rate_7d_av = value) %>%
select(geo_value, time_value, cases = value) %>%
arrange(geo_value, time_value)

deaths_7dav_incidence_prop <- pub_covidcast(
confirmed_7dav_incidence_num <- pub_covidcast(
source = "jhu-csse",
signals = "deaths_7dav_incidence_prop",
signals = "confirmed_7dav_incidence_num",
geo_type = "state",
time_type = "day",
geo_values = "ca,fl,ny,tx,ga,pa",
time_values = epirange(20200301, 20211231),
) %>%
select(geo_value, time_value, death_rate_7d_av = value) %>%
select(geo_value, time_value, cases_7d_av = value) %>%
arrange(geo_value, time_value)

confirmed_incidence_num <- pub_covidcast(
confirmed_7dav_incidence_prop <- pub_covidcast(
source = "jhu-csse",
signals = "confirmed_incidence_num",
signals = "confirmed_7dav_incidence_prop",
geo_type = "state",
time_type = "day",
geo_values = "ca,fl,ny,tx,ga,pa",
time_values = epirange(20200301, 20211231),
) %>%
select(geo_value, time_value, cases = value) %>%
select(geo_value, time_value, case_rate_7d_av = value) %>%
arrange(geo_value, time_value)

confirmed_7dav_incidence_num <- pub_covidcast(
deaths_7dav_incidence_prop <- pub_covidcast(
source = "jhu-csse",
signals = "confirmed_7dav_incidence_num",
signals = "deaths_7dav_incidence_prop",
geo_type = "state",
time_type = "day",
geo_values = "ca,fl,ny,tx,ga,pa",
time_values = epirange(20200301, 20211231),
) %>%
select(geo_value, time_value, cases_7d_av = value) %>%
select(geo_value, time_value, death_rate_7d_av = value) %>%
arrange(geo_value, time_value)

jhu_csse_daily_subset <- confirmed_7dav_incidence_prop %>%
full_join(deaths_7dav_incidence_prop,
jhu_csse_daily_subset <- confirmed_incidence_num %>%
full_join(confirmed_7dav_incidence_num,
by = c("geo_value", "time_value")
) %>%
full_join(confirmed_incidence_num,
full_join(confirmed_7dav_incidence_prop,
by = c("geo_value", "time_value")
) %>%
full_join(confirmed_7dav_incidence_num,
full_join(deaths_7dav_incidence_prop,
by = c("geo_value", "time_value")
) %>%
as_epi_df()
Expand Down
Binary file modified data/jhu_csse_daily_subset.rda
Binary file not shown.