Skip to content

Retain epi df class #379

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 3 commits into from
Sep 30, 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
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
Loading