You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If epi_recipe() is provided data that's not an epi_df, it will output a regular recipe rather than an epi_recipe, causing some step functions to output somewhat confusing messages.
Artificial example:
library(epipredict)
#> Loading required package: epiprocess#> #> Attaching package: 'epiprocess'#> The following object is masked from 'package:stats':#> #> filter#> Loading required package: parsnip
library(tibble)
epi_recipe(as_tibble(case_death_rate_subset)) %>%
step_epi_ahead(death_rate, ahead=7) %>%
step_epi_lag(death_rate, lag= c(0,7,14))
#> Error in `step_epi_ahead()`:#> ! This recipe step can only operate on an `epi_recipe`.
More realistically, @dshemetov and I ran into this when feeding in a covidcast_signal before it had been converted to epi_df format.
A couple quick ideas on potential resolutions:
Add S3 methods to the steps for regular recipes, just to give better error messages.
Always output an epi_recipe from epi_recipe(), but complain in step functions if the appropriate roles have not been set. This might require fixing some hard-coded references to geo_value and/or time_value columns (rather than selecting based on roles) in some steps.
The text was updated successfully, but these errors were encountered:
If
epi_recipe()
is provided data that's not anepi_df
, it will output a regularrecipe
rather than anepi_recipe
, causing some step functions to output somewhat confusing messages.Artificial example:
Created on 2023-04-26 by the reprex package (v2.0.1)
More realistically, @dshemetov and I ran into this when feeding in a
covidcast_signal
before it had been converted toepi_df
format.A couple quick ideas on potential resolutions:
epi_recipe
fromepi_recipe()
, but complain in step functions if the appropriate roles have not been set. This might require fixing some hard-coded references togeo_value
and/ortime_value
columns (rather than selecting based on roles) in some steps.The text was updated successfully, but these errors were encountered: