diff --git a/NEWS.md b/NEWS.md index 1d98f7a5a..3d02b9811 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/data.R b/R/data.R index ead3dfdd4..c528039ce 100644 --- a/R/data.R +++ b/R/data.R @@ -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" diff --git a/data-raw/jhu_csse_daily_subset.R b/data-raw/jhu_csse_daily_subset.R index 14ca85c84..affeb1935 100644 --- a/data-raw/jhu_csse_daily_subset.R +++ b/data-raw/jhu_csse_daily_subset.R @@ -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() diff --git a/data/jhu_csse_daily_subset.rda b/data/jhu_csse_daily_subset.rda index 6d073eea3..12fd5f15c 100644 Binary files a/data/jhu_csse_daily_subset.rda and b/data/jhu_csse_daily_subset.rda differ