Skip to content

Add function or prominent documentation about how to get a single group&reftime slide input #60

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

Closed
brookslogan opened this issue Mar 28, 2022 · 2 comments · Fixed by #538
Assignees
Labels
P1 medium priority

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Mar 28, 2022

Relates to: epi_slide, epix_slide, epi_df, epi_archive.

In evalcast, one major user issue with get_predictions was that there was no corresponding get_inputs function, and it took a bit of hacking to see what the input to the forecasters actually looked like. Things seem possible in epiprocess without any environment/global/attribute-storage hacks:

library(epiprocess)
library(dplyr)
example_geo_value = "ca"
example_ref_time_value = as.Date("2020-03-20")
jhu_csse_daily_subset %>% 
  group_by(.data$geo_value) %>% 
  filter(.data$geo_value == .env$example_geo_value) %>%
  epi_slide(~ tibble(data=list(.env$.x)), before = 6, ref_time_values=example_ref_time_value) %>%
  pull(.data$slide_value_data)

but this still seems a bit nontrivial.

It seems worth making this type of operation into a function or part of the epi[x]_slide documentation.

@ryantibs
Copy link
Member

ryantibs commented Apr 5, 2022

@lcbrooks Thanks! I think just documenting this somewhere seems sufficient, no? Perhaps this is worth putting into one of the vignettes.

What do you think about the advanced sliding vignette---in the last example in that vignette, where we talk about forecasting? Or in the archive vignette---in its last example, where we talk about forecasting?

@brookslogan
Copy link
Contributor Author

I think this would be a fairly common operation, so maybe both vignettes + the help documentation if we include an @examples section.

If used, the code above should be edited so the user can just copy & paste and get some example input for any epi_df they are working with quickly. Another issue... while the code might point out to a user their code that they forgot a group_by(geo_value), maybe it's too easy to overlook (I've already made this mistake while trying out this code again...); this might be an argument for turning this into a function (that can be easily swapped with epi[x]_slide for dev & debugging), or maybe it's more hinting that we need to do something else to help users not forget to group_by(geo_value).

@brookslogan brookslogan added the P1 medium priority label May 24, 2022
@dshemetov dshemetov self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants