Skip to content

Commit 7cc4a8f

Browse files
authored
Merge pull request #382 from cmu-delphi/ndefries/epidatasets-migration
Ndefries/epidatasets migration
2 parents e9f5924 + 4001e19 commit 7cc4a8f

File tree

124 files changed

+275
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+275
-596
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ URL: https://github.com/cmu-delphi/epipredict/,
2525
BugReports: https://github.com/cmu-delphi/epipredict/issues/
2626
Depends:
2727
epiprocess (>= 0.9.0),
28+
epidatasets,
2829
parsnip (>= 1.0.0),
2930
R (>= 3.5.0)
3031
Imports:
@@ -49,7 +50,6 @@ Imports:
4950
workflows (>= 1.0.0)
5051
Suggests:
5152
data.table,
52-
epidatasets,
5353
epidatr (>= 1.0.0),
5454
fs,
5555
grf,
@@ -69,6 +69,7 @@ Suggests:
6969
VignetteBuilder:
7070
knitr
7171
Remotes:
72+
cmu-delphi/epidatasets,
7273
cmu-delphi/epidatr,
7374
cmu-delphi/epiprocess,
7475
dajmcdon/smoothqr

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export(update_model)
215215
export(validate_layer)
216216
export(weighted_interval_score)
217217
import(distributional)
218+
import(epidatasets)
218219
import(epiprocess)
219220
import(parsnip)
220221
import(recipes)

NEWS.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicat
44

55
# epipredict 0.2
66

7-
## features
7+
## Breaking changes
8+
9+
- Moved example datasets from being hosted in the package to being loaded
10+
from the `epidatasets` package. The datasets can no longer be loaded with
11+
`data(<dataset name>)`, but can be accessed with
12+
`data(<dataset name>, package = "epidatasets")`, `epidatasets::<dataset name>`
13+
or, after loading the package, the name of the dataset alone (#382).
14+
15+
## Improvements
16+
817
- Add `step_adjust_latency`, which give several methods to adjust the forecast if the `forecast_date` is after the last day of data.
918
- (temporary) ahead negative is allowed for `step_epi_ahead` until we have `step_epi_shift`
1019

11-
## bugfixes
12-
- shifting no columns results in no error for either `step_epi_ahead` and `step_epi_lag`
20+
## Bug fixes
21+
- Shifting no columns results in no error for either `step_epi_ahead` and `step_epi_lag`
1322
- Quantiles produced by `grf` were sometimes out of order.
1423

1524
# epipredict 0.1

R/arx_classifier.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#'
2828
#' @examples
2929
#' library(dplyr)
30-
#' jhu <- case_death_rate_subset %>%
30+
#' jhu <- covid_case_death_rates %>%
3131
#' filter(time_value >= as.Date("2021-11-01"))
3232
#'
3333
#' out <- arx_classifier(jhu, "death_rate", c("case_rate", "death_rate"))
@@ -104,7 +104,7 @@ arx_classifier <- function(
104104
#' @seealso [arx_classifier()]
105105
#' @examples
106106
#' library(dplyr)
107-
#' jhu <- case_death_rate_subset %>%
107+
#' jhu <- covid_case_death_rates %>%
108108
#' filter(time_value >= as.Date("2021-11-01"))
109109
#'
110110
#' arx_class_epi_workflow(jhu, "death_rate", c("case_rate", "death_rate"))

R/arx_forecaster.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#' @seealso [arx_fcast_epi_workflow()], [arx_args_list()]
2626
#'
2727
#' @examples
28-
#' jhu <- case_death_rate_subset %>%
28+
#' jhu <- covid_case_death_rates %>%
2929
#' dplyr::filter(time_value >= as.Date("2021-12-01"))
3030
#'
3131
#' out <- arx_forecaster(
@@ -96,7 +96,7 @@ arx_forecaster <- function(
9696
#'
9797
#' @examples
9898
#' library(dplyr)
99-
#' jhu <- case_death_rate_subset %>%
99+
#' jhu <- covid_case_death_rates %>%
100100
#' filter(time_value >= as.Date("2021-12-01"))
101101
#'
102102
#' arx_fcast_epi_workflow(

R/autoplot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ggplot2::autoplot
2929
#' @name autoplot-epipred
3030
#' @examples
3131
#' library(dplyr)
32-
#' jhu <- case_death_rate_subset %>%
32+
#' jhu <- covid_case_death_rates %>%
3333
#' filter(time_value >= as.Date("2021-11-01"))
3434
#'
3535
#' r <- epi_recipe(jhu) %>%
@@ -70,7 +70,7 @@ ggplot2::autoplot
7070
#'
7171
#' # ------- Plotting canned forecaster output
7272
#'
73-
#' jhu <- case_death_rate_subset %>%
73+
#' jhu <- covid_case_death_rates %>%
7474
#' filter(time_value >= as.Date("2021-11-01"))
7575
#' flat <- flatline_forecaster(jhu, "death_rate")
7676
#' autoplot(flat, .max_facets = 4)

R/cdc_baseline_forecaster.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#'
2424
#' @examples
2525
#' library(dplyr)
26-
#' weekly_deaths <- case_death_rate_subset %>%
26+
#' weekly_deaths <- covid_case_death_rates %>%
2727
#' select(geo_value, time_value, death_rate) %>%
2828
#' left_join(state_census %>% select(pop, abbr), by = c("geo_value" = "abbr")) %>%
2929
#' mutate(deaths = pmax(death_rate / 1e5 * pop * 7, 0)) %>%

R/data.R

Lines changed: 0 additions & 87 deletions
This file was deleted.

R/epi_recipe.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ epi_recipe.default <- function(x, ...) {
4343
#' @examples
4444
#' library(dplyr)
4545
#' library(recipes)
46-
#' jhu <- case_death_rate_subset %>%
46+
#' jhu <- covid_case_death_rates %>%
4747
#' filter(time_value > "2021-08-01") %>%
4848
#' arrange(geo_value, time_value)
4949
#'
@@ -263,7 +263,7 @@ is_epi_recipe <- function(x) {
263263
#' library(dplyr)
264264
#' library(recipes)
265265
#'
266-
#' jhu <- case_death_rate_subset %>%
266+
#' jhu <- covid_case_death_rates %>%
267267
#' filter(time_value > "2021-08-01") %>%
268268
#' arrange(geo_value, time_value)
269269
#'
@@ -347,7 +347,7 @@ update_epi_recipe <- function(x, recipe, ..., blueprint = default_epi_recipe_blu
347347
#' library(dplyr)
348348
#' library(workflows)
349349
#'
350-
#' jhu <- case_death_rate_subset %>%
350+
#' jhu <- covid_case_death_rates %>%
351351
#' filter(time_value > "2021-11-01", geo_value %in% c("ak", "ca", "ny"))
352352
#' r <- epi_recipe(jhu) %>%
353353
#' step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%

R/epi_workflow.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' @importFrom generics augment
2121
#' @export
2222
#' @examples
23-
#' jhu <- case_death_rate_subset
23+
#' jhu <- covid_case_death_rates
2424
#'
2525
#' r <- epi_recipe(jhu) %>%
2626
#' step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%
@@ -84,7 +84,7 @@ is_epi_workflow <- function(x) {
8484
#' @name fit-epi_workflow
8585
#' @export
8686
#' @examples
87-
#' jhu <- case_death_rate_subset %>%
87+
#' jhu <- covid_case_death_rates %>%
8888
#' filter(time_value > "2021-11-01", geo_value %in% c("ak", "ca", "ny"))
8989
#'
9090
#' r <- epi_recipe(jhu) %>%
@@ -142,7 +142,7 @@ fit.epi_workflow <- function(object, data, ..., control = workflows::control_wor
142142
#' @name predict-epi_workflow
143143
#' @export
144144
#' @examples
145-
#' jhu <- case_death_rate_subset
145+
#' jhu <- covid_case_death_rates
146146
#'
147147
#' r <- epi_recipe(jhu) %>%
148148
#' step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%

0 commit comments

Comments
 (0)