Skip to content
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

Move epipredict vignette datasets to epidatasets #5

Merged
merged 59 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
01b71e3
Change to just file `LICENSE`, add `@source` for CTIS data
brookslogan Jun 14, 2023
4dc2306
describe format for all datasets; unify doc section naming format
nmdefries Jul 6, 2023
0bfcc1e
documentation wording
nmdefries Jul 7, 2023
e8d975a
move data dictionary docs to separate section to ensure heritability
nmdefries Jul 12, 2023
9ea783c
build docs
nmdefries Jul 12, 2023
d98b829
add data contributors as authors
nmdefries Jul 12, 2023
2b00f03
remove dangling partial attribution for CTIS data
nmdefries Aug 1, 2023
403e890
remove copyright holder info for CTIS. Resolve in issue cmu-delphi/ep…
nmdefries Aug 1, 2023
b9cab85
note use in epiprocess vignettes
nmdefries Jul 13, 2023
a66ebd1
build docs
nmdefries May 31, 2024
aec5488
Merge branch 'lcb/activate-roxygen-markdown' into lcb/adjust-attribution
nmdefries May 31, 2024
09abc23
archive, cases_deaths doc wording
nmdefries May 31, 2024
854401b
county and outlier doc line wrapping
nmdefries May 31, 2024
653fd18
add description tag to keep external use in top-level description
nmdefries Aug 30, 2024
4226ecc
outlier dataset uses nj, not ca data
nmdefries Aug 30, 2024
af635dc
add nat as maintainer
nmdefries Sep 4, 2024
d4a1a42
title suggestions
nmdefries Sep 5, 2024
4e8119e
attribute COVID Canada working group
nmdefries Sep 5, 2024
a9ad878
match wording between data attributions
nmdefries Sep 5, 2024
bca6556
build docs with new data titles
nmdefries Sep 5, 2024
89d8bd6
convert archive..._dt to archive
nmdefries Sep 6, 2024
0017d3a
generate all datasets with explicit as_of
nmdefries Sep 6, 2024
20a0142
document all as_ofs
nmdefries Sep 6, 2024
adccc93
check if epiprocess installed on load
nmdefries Sep 9, 2024
aacbe27
remove on-load error
nmdefries Sep 12, 2024
18c7a60
on data load, convert to epiprocess object if epiprocess installed
nmdefries Sep 12, 2024
0cf2d69
describe archive format of can_prov_cases
nmdefries Sep 13, 2024
04339e3
use helper to modify rather than overwrite sysdata.rda
nmdefries Sep 13, 2024
49b622c
warn on data load if epiprocess not installed
nmdefries Sep 13, 2024
046ac65
update links and types in docs
nmdefries Sep 13, 2024
ee36573
document new links and types
nmdefries Sep 13, 2024
1173874
remove discontinued direction field from jhu
nmdefries Sep 13, 2024
bcb3e44
zero-pad state census fips
nmdefries Sep 16, 2024
4d561d8
document JHU missings as "NA"
nmdefries Sep 16, 2024
89d8aa9
Merge branch 'main' into lcb/adjust-attribution
nmdefries Sep 16, 2024
59c4d89
covid_case_death_rates should only import starting from Dec 2020
nmdefries Sep 17, 2024
89de76e
add canadian grad income dataset
nmdefries Sep 18, 2024
d9bc11d
add attribution for doctor-visits
nmdefries Sep 25, 2024
8769da3
double-check attribution and modifications to all datasets
nmdefries Sep 25, 2024
a42a262
move epiprocess vignette datasets to epidatasets; move existing from …
nmdefries Sep 21, 2024
1030ae7
don't wrap href
nmdefries Sep 26, 2024
2cbe3d1
helper avoid error when sysdata.rda is empty
nmdefries Sep 26, 2024
51452a1
use stronger compression on external data files
nmdefries Sep 26, 2024
c43f260
use stronger compression on internal data
nmdefries Sep 26, 2024
a36b316
Merge branch 'lcb/adjust-attribution' into ndefries/epipredict-support
nmdefries Sep 26, 2024
c129398
remove territories from all_states archive to match epipredict original
nmdefries Sep 27, 2024
472f213
update sizes, attribution for new datasets
nmdefries Sep 27, 2024
e94f8a6
save new datasetes with xz compression
nmdefries Sep 27, 2024
13a72b7
save datasets with version=2 in `save` for backwards compatibility
nmdefries Sep 28, 2024
a4c9294
change additional_args to match epiprocess 0.9.0 paradigm
nmdefries Sep 30, 2024
b80ac35
Merge branch 'main' into ndefries/epipredict-support
nmdefries Oct 1, 2024
79867a2
rename datasets from _dt to _tbl within data-generation scripts
nmdefries Oct 1, 2024
6ab1437
covid_case_death_rates should only import starting from Dec 31 2020
nmdefries Oct 2, 2024
dba2e30
Create extended covid rates data (#8)
nmdefries Oct 4, 2024
736eb64
rename jhu_confirmed_cumulative_num to covid_confirmed_cumulative_num
nmdefries Oct 4, 2024
5b5846e
add a helper to source all data-generating files
nmdefries Oct 4, 2024
de3289f
notate use in correlation vignette
nmdefries Oct 4, 2024
d08c6cc
change join type on covid_incidence_county_subset
nmdefries Oct 4, 2024
47b3ca0
Replace `.before = 365000L`
brookslogan Oct 14, 2024
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
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Authors@R: c(
person("Nat", "DeFries", email="[email protected]", role = c("cre", "aut")),
person("Johns Hopkins University Center for Systems Science and Engineering", role = "dtc", comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
person("Johns Hopkins University", role = "cph", comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
person("Carnegie Mellon University Delphi Group", role = "dtc", comment = "Owner of masking and social-distancing data from the COVID-19 Trends and Impacts Survey. Owner of claims-based CLI data from the Delphi Epidata API"),
person("Carnegie Mellon University Delphi Group", role = "dtc", comment = "Owner of masking, social-distancing, and CLI data from the COVID-19 Trends and Impacts Survey. Owner of claims-based CLI data from the Delphi Epidata API"),
person("The COVID-19 Canada Open Data Working Group", role = "dtc", comment = "Owner of Canadian COVID-19 cases rates from the Covid19Canada data repository"),
person("Statistics Canada", role = "dtc", comment = "Owner of Canadian graduate employment income data from the Statistics Canada website")
person("Statistics Canada", role = "dtc", comment = "Owner of Canadian graduate employment income data from the Statistics Canada website"),
person("Google", role = "dtc", comment = "Collaborator on CLI data from the Google symptom surveys")
)
Description: This package contains data sets used to compile vignettes and
other documentation in Delphi R Packages. The goal is to avoid calls
Expand Down
154 changes: 148 additions & 6 deletions R/epipredict-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#' This data source of confirmed COVID-19 cases and deaths is based on reports
#' made available by the Center for Systems Science and Engineering at Johns
#' Hopkins University, as downloaded from the CMU Delphi COVIDcast Epidata
#' API. This example data is a snapshot as of March 20, 2024, and
#' API. This example data is a snapshot as of May 31, 2022, and
#' ranges from December 31, 2020 to December 31, 2021. It
#' includes all states. It is used in the {epiprocess} correlation vignette.
#' includes all states.
#'
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 37576 rows and 4 columns.
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 20496 rows and 4 columns.
#' @section Data dictionary:
#' The data has columns:
#' \describe{
Expand Down Expand Up @@ -76,7 +76,7 @@
#' ranges from June 4, 2021 to December 31, 2021.
#' It is limited to California, Florida, Texas, New Jersey, and New York.
#'
#' @format A [`tibble::tibble`] (object of class `c("tbl_df", "tbl", "data.frame")`) with 1055 rows and 4 columns.
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 1055 rows and 4 columns.
#' @section Data dictionary:
#' The data has columns:
#' \describe{
Expand Down Expand Up @@ -195,15 +195,14 @@
#' www.statcan.gc.ca. This example data is a snapshot as of September 18,
#' 2024, and ranges from 2010 to 2017 (yearly).
#'
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 10193 rows and 8 columns.
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 1445 rows and 7 columns.
#' @section Data dictionary:
#' The data has columns:
#' \describe{
#' \item{geo_value}{The province in Canada associated with each
#' row of measurements.}
#' \item{time_value}{The time value, a year integer in YYYY format}
#' \item{edu_qual}{The education qualification}
#' \item{fos}{The field of study}
#' \item{age_group}{The age group; either 15 to 34 or 35 to 64}
#' \item{num_graduates}{The number of graduates for the given row of characteristics}
#' \item{med_income_2y}{The median employment income two years after graduation}
Expand All @@ -226,3 +225,146 @@
#' drop the level-specific rows.
#' * No modifications were made to the time range of the data.
"grad_employ_subset"

#' Percent CLI from different surveys, compared to ground truth COVID incidence in a subset of counties
#'
#' @description
#' Data set for more than 400 US counties containing CLI
#' (COVID-19-like-illness) incidence derived from two surveys, and a reference signal as
#' reported by JHU CSSE. This example data is a snapshot as of September 21,
#' 2020, and ranges from April 11, 2020 to September 01, 2020.
#'
#' The reference signal `case` is based on reports made available
#' by the Center for Systems Science and Engineering at Johns Hopkins
#' University.
#'
#' One survey was
#' \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/google-survey.html}{run by Google},
#' in partnership with Delphi.
#'
#' The other survey, the
#'\href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/fb-survey.html}{COVID-19 Trends and Impact Survey},
#' was run by Delphi in collaboration with Facebook.
#'
#' Data is reported for counties that had at least 200 cumulative COVID-19 cases
#' on May 14, 2020, according to JHU CSSE.
#'
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 63840 rows and 5 columns.
#' @section Data dictionary:
#' The data has columns:
#' \describe{
#' \item{geo_value}{The 5-digit county FIPS code associated with each
#' row of measurements.}
#' \item{time_value}{The time value, a date in YYYY-MM-DD format}
#' \item{goog}{Seven-day average of CLI (covid-like-illness) cases from the Google survey}
#' \item{fb}{Seven-day average of CLI (covid-like-illness) cases from CTIS}
#' \item{case}{Reference signal. Seven-day average of CLI (covid-like-illness) cases}
#' }
#' @source
#' This object contains a modified part of the \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University} as \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{republished in the COVIDcast Epidata API}. This data set is licensed under the terms of the
#' \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0 International license}
#' by Johns Hopkins University on behalf of its Center for Systems Science 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}: The signal `confirmed_cumulative_num` was used to determine eligibility for inclusion. The signal `confirmed_7dav_incidence_prop` was computed by Delphi from the original JHU-CSSE data 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 specific time range, the
#' signal names slightly altered, and formatted into an `epi_df`.
#'
#' This object contains a modified part of the
#' \href{https://cmu-delphi.github.io/delphi-epidata/symptom-survey/#covid-19-trends-and-impact-survey}{data
#' aggregations in the API} that are prepared from the
#' \href{https://www.pnas.org/doi/full/10.1073/pnas.2111454118}{COVID-19
#' Trends and Impact Survey}; see the first link for more information on
#' citing in publications.
#' The data is made available via the
#' \href{https://cmu-delphi.github.io/delphi-epidata/}{Delphi Epidata API}.
#'
#' These aggregations are licensed under the terms of
#' the \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons
#' Attribution license}.
#'
#' Modifications:
#' * The data has been limited to a very small number of rows, the
#' signal names slightly altered, and formatted into an `epi_df`.
#'
#' This object contains a modified part of the
#' \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/google-survey.html}{Google symptom surveys}.
#' Aggregations based on the survey are licensed under the terms of
#' the \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons
#' Attribution license}.
#'
#' Modifications:
#' * The data has been limited to a very small number of rows, the
#' signal names slightly altered, and formatted into an `epi_df`.
"county_smoothed_cli_comparison"

#' Daily COVID-19 case and death rates from all states in archive format
#'
#' @description
#' Data set containing COVID-19 case and death rates (counts per 100000
#' population) as reported by the Delphi API, based on reports made available
#' by the Center for Systems Science and Engineering at Johns Hopkins
#' University. This example data ranges from March 1, 2020 to November 30,
#' 2021, issued monthly on the first day of each month from September 1, 2020
#' to December 1, 2021. It includes all US states, Washington DC, Guam, Puerto
#' Rico, and the Virgin Islands.
#'
#' @format An [`epiprocess::epi_archive`]. The DT attribute contains the data formatted as a [`data.table::data.table`] (object of class `c("data.table", "data.frame")`) with 72086 rows and 7 columns.
#' @section Data dictionary:
#' The data in the `epi_archive$DT` attribute has columns:
#' \describe{
#' \item{geo_value}{the geographic value associated with each row of measurements.}
#' \item{time_value}{the time value associated with each row of measurements.}
#' \item{version}{the time value specifying the version for each row of measurements. }
#' \item{case_rate}{Number of new confirmed cases due to COVID-19 per 100,000 population, daily}
#' \item{case_rate_7d_av}{7-day average signal of number of new confirmed cases due to COVID-19 per 100,000 population, daily}
#' \item{death_rate}{Number of new confirmed deaths due to COVID-19 per 100,000 population, daily}
#' \item{death_rate_7d_av}{7-day average signal of number of new confirmed deaths due to COVID-19 per 100,000 population, daily}
#' }
#' @source
#' This object contains a modified part of the \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University} as \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{republished in the COVIDcast Epidata API}. This data set is licensed under the terms of the
#' \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0 International license}
#' by Johns Hopkins University on behalf of its Center for Systems Science 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}: The signals `case_rate` and `death_rate` are taken directly from the JHU CSSE GitHub repo without changes, served through the Delphi API.
#' * \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{From the COVIDcast Epidata API}: Averaged signals were computed from the original JHU-CSSE data 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 specific time range, the
#' signal names slightly altered, and formatted into an `epi_archive`.
"case_death_rate_archive"

#' Daily COVID-19 doctor visits and cases from all states in archive format
#' @description
#' This data source is based on information about outpatient visits, provided
#' to us by health system partners, and also contains confirmed COVID-19
#' cases based on reports made available by the Center for Systems Science
#' and Engineering at Johns Hopkins University. This example data ranges from
#' June 1, 2020 to December 1, 2021, issued on dates from June 1, 2020 to December 1,
#' 2021. It includes all US states.
#'
#' It is used in the {epipredict} `sliding` article.
#'
#' @format An [`epiprocess::epi_archive`]. The DT attribute contains the data formatted as a [`data.table::data.table`] (object of class `c("data.table", "data.frame")`) with 1514489 rows and 5 columns.
#' @section Data dictionary:
#' The data in the `epi_archive$DT` attribute has columns:
#' \describe{
#' \item{geo_value}{the geographic value associated with each row of measurements.}
#' \item{time_value}{the time value associated with each row of measurements.}
#' \item{version}{the time value specifying the version for each row of measurements. }
#' \item{percent_cli}{percentage of doctor’s visits with CLI (COVID-like illness) computed from medical insurance claims}
#' \item{case_rate}{7-day average signal of number of new confirmed cases due to COVID-19 per 100,000 population, daily}
#' }
#' @source
#' This object contains a modified part of the \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University} as \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{republished in the COVIDcast Epidata API}. This data set is licensed under the terms of the
#' \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0 International license}
#' by Johns Hopkins University on behalf of its Center for Systems Science in Engineering.
#' Copyright Johns Hopkins University 2020.
#'
#' Modifications:
#' * \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/doctor-visits.html}{From the COVIDcast Doctor Visits API}: The signal `percent_cli` is taken directly from the API without changes.
#' * \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{From the COVIDcast Epidata API}: `case_rate` signal was computed by Delphi from the original JHU-CSSE data 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 an `epi_archive`.
"archive_cases_dv_subset_all_states"
43 changes: 42 additions & 1 deletion R/epiprocess-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,45 @@
#' These signals are taken directly from the JHU CSSE \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 GitHub repository} without changes.
#' * Furthermore, the data has been limited to a very small number of rows,
#' formatted into an `epi_df`, and the signal names slightly altered.
"jhu_confirmed_cumulative_num"
"covid_confirmed_cumulative_num"

#' JHU daily COVID-19 cases and deaths rates from all states
#'
#' This data source of confirmed COVID-19 cases and deaths is based on reports
#' made available by the Center for Systems Science and Engineering at Johns
#' Hopkins University, as downloaded from the CMU Delphi COVIDcast Epidata
#' API. This example data is a snapshot as of May 31, 2022, and
#' ranges from March 1, 2020 to December 31, 2021. It
#' includes all states.
#'
#' It is used in the {epiprocess} correlation vignettes.
#'
#' @format An [`epiprocess::epi_df`] (object of class `c("epi_df", "tbl_df", "tbl", "data.frame")`) with 37576 rows and 4 columns.
#' @section Data dictionary:
#' The data has columns:
#' \describe{
#' \item{geo_value}{the geographic value associated with each row
#' of measurements.}
#' \item{time_value}{the time value associated with each row of measurements.}
#' \item{case_rate}{7-day average signal of number of new
#' confirmed COVID-19 cases per 100,000 population, daily}
#' \item{death_rate}{7-day average signal of number of new confirmed
#' deaths due to COVID-19 per 100,000 population, daily}
#' }
#' @source This object contains a modified part of the
#' \href{https://github.com/CSSEGISandData/COVID-19}{COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University}
#' as \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html}{republished in the COVIDcast Epidata API}.
#' This data set is licensed under the terms of the
#' \href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons Attribution 4.0 International license}
#' by the Johns Hopkins University on behalf of its Center for Systems Science
#' 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.
"covid_case_death_rates_extended"
Binary file modified R/sysdata.rda
Binary file not shown.
4 changes: 3 additions & 1 deletion data-raw/_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ save_to_sysdata <- function(obj, obj_name) {
list = names(sysdata_env),
file = internal_data_path,
envir = sysdata_env,
compress = "xz"
compress = "xz",
# For backwards compatibility with older R versions (<3.5)
version = 2
)
}
16 changes: 16 additions & 0 deletions data-raw/_run_all.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
library(here)

internal_data_path <- here("data-raw")
files <- list.files(
internal_data_path, pattern = ".*[.]R",
full.names = FALSE
)
for (file in files) {
if (startsWith(file, "_")) {
# File is a helper script and does not generate data.
next
}
path <- here(file.path("data-raw", file))
message("running ", path, " ...")
source(path)
}
49 changes: 49 additions & 0 deletions data-raw/archive_cases_dv_subset_all_states_tbl.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
library(dplyr)
library(epidatr)
library(epiprocess)

source(here::here("data-raw/_helper.R"))

dv_subset <- pub_covidcast(
source = "doctor-visits",
signals = "smoothed_adj_cli",
time_type = "day",
geo_type = "state",
time_values = epirange(20200601, 20211201),
geo_values = "*",
issues = epirange(20200601, 20211201)
) %>%
select(geo_value, time_value, version = issue, percent_cli = value) %>%
# Drop DC and territories.
filter(!(geo_value %in% c("as", "gu", "dc", "mp", "pr", "vi"))) %>%
# We're using compactify=FALSE here and below to avoid some testthat test
# failures on tests that were based on a non-compactified version.
as_epi_archive(compactify = FALSE)

case_rate_subset <- pub_covidcast(
source = "jhu-csse",
signals = "confirmed_7dav_incidence_prop",
time_type = "day",
geo_type = "state",
time_values = epirange(20200601, 20211201),
geo_values = "*",
issues = epirange(20200601, 20211201)
) %>%
select(geo_value, time_value, version = issue, case_rate_7d_av = value) %>%
filter(!(geo_value %in% c("as", "gu", "dc", "mp", "pr", "vi"))) %>%
as_epi_archive(compactify = FALSE)

# Use `epiprocess::epix_merge` to avoid having to reimplement `sync`ing
# behavior. After merging, convert DT component back to tibble.
archive_cases_dv_subset_all_states_tbl = epix_merge(
dv_subset, case_rate_subset,
sync = "locf",
compactify = TRUE)$DT %>%
as_tibble()

# We're trying to do:
# usethis::use_data(archive_cases_dv_subset_all_states_tbl, internal = TRUE, overwrite = TRUE, compress = "xz")
# but `usethis::use_data` can only store multiple objects if they're added in
# the same call. This workaround is from
# https://github.com/r-lib/usethis/issues/1512
save_to_sysdata(archive_cases_dv_subset_all_states_tbl, "archive_cases_dv_subset_all_states_tbl")
Loading
Loading