Skip to content

Commit

Permalink
Merge pull request #379 from cmu-delphi/retain-epi_df-class
Browse files Browse the repository at this point in the history
Retain epi df class
  • Loading branch information
dshemetov authored Sep 30, 2024
2 parents 525618a + 9c35fb9 commit db2cfee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: epipredict
Title: Basic epidemiology forecasting methods
Version: 0.0.21
Version: 0.0.22
Authors@R: c(
person("Daniel", "McDonald", , "[email protected]", role = c("aut", "cre")),
person("Ryan", "Tibshirani", , "[email protected]", role = "aut"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.0.x will indicat
- Add `step_epi_slide` to produce generic sliding computations over an `epi_df`
- Add quantile random forests (via `{grf}`) as a parsnip engine
- Replace `epi_keys()` with `epiprocess::key_colnames()`, #352
- Try to retain the `epi_df` class during baking to the extent possible, #376
2 changes: 2 additions & 0 deletions R/epi_recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ epi_recipe.default <- function(x, ...) {
#' r
epi_recipe.epi_df <-
function(x, formula = NULL, ..., vars = NULL, roles = NULL) {
attr(x, "decay_to_tibble") <- FALSE
if (!is.null(formula)) {
if (!is.null(vars)) {
rlang::abort(
Expand Down Expand Up @@ -160,6 +161,7 @@ epi_recipe.formula <- function(formula, data, ...) {
return(recipes::recipe(formula, data, ...))
}

attr(data, "decay_to_tibble") <- FALSE
f_funcs <- recipes:::fun_calls(formula, data)
if (any(f_funcs == "-")) {
abort("`-` is not allowed in a recipe formula. Use `step_rm()` instead.")
Expand Down

0 comments on commit db2cfee

Please sign in to comment.