Skip to content

Conversation

@dajmcdon
Copy link
Contributor

Closes #51 .

  • Removed the offending as_tibble.epi_df() method.
  • Replaced by creating some alternative special processors.

Copy link
Contributor

@dshemetov dshemetov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some Slack back and forth, this looks quite good! The summary for me was that the workflow in epipredict looks like

library(epiprocess)
library(dplyr)
library(recipes)

jhu <- jhu_csse_daily_subset %>%
  filter(time_value > "2021-08-01") %>%
  select(geo_value:death_rate_7d_av) %>%
  rename(case_rate = case_rate_7d_av, death_rate = death_rate_7d_av)

r <- epi_recipe(jhu) %>%
  step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%
  step_epi_ahead(death_rate, ahead = 7) %>%
  step_epi_lag(case_rate, lag = c(0, 7, 14)) %>%
  step_naomit(all_predictors()) %>%
  step_naomit(all_outcomes(), skip = TRUE)

workflow <- epi_workflow() %>%
  add_epi_recipe(r)

In that last step, we add default_epi_recipe_blueprint, which has now been customized to not call check_is_data, which contains a call to as_tibble. This dodges our issues with needing to overwrite as_tibble.

@dajmcdon dajmcdon merged commit a8fefdd into frosting Jun 24, 2022
@dajmcdon dajmcdon deleted the 51-replace-as_tibble branch June 24, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Find long-term solution to as_tibble.epi_df

2 participants