Skip to content

51 replace as tibble #65

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
Jun 24, 2022
Merged

51 replace as tibble #65

merged 3 commits into from
Jun 24, 2022

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