Skip to content

epix_slide fails on yearmonths #648

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 29, 2025 · 0 comments · Fixed by #645
Closed

epix_slide fails on yearmonths #648

brookslogan opened this issue Mar 29, 2025 · 0 comments · Fixed by #645
Assignees

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Mar 29, 2025

suppressPackageStartupMessages({
library(dplyr)
library(tsibble)
library(epiprocess)
})

tibble(geo_value = 1, time_value = yearmonth(1:5), version = yearmonth(6), value = 1:5) %>%
  as_epi_archive() %>%
  epix_slide(~ .x)
#> Error in UseMethod("full_seq"): no applicable method for 'full_seq' applied to an object of class "c('yearmonth', 'vctrs_vctr')"

tibble(geo_value = 1, time_value = yearmonth(1:5), version = yearmonth(6), value = 1:5) %>%
  as_epi_archive() %>%
  epix_slide(~ .x, .versions = yearmonth(6))
#> Warning in max(geo_value): no non-missing arguments to max; returning -Inf
#> # A tibble: 0 × 4
#> # ℹ 4 variables: version <mth>, geo_value <dbl>, time_value <mth>, value <int>

Created on 2025-03-28 with reprex v2.1.1

The first case seems self-explanatory; we rely on full_seq when it doesn't have an impl for yearmonths. The second case's weird max(geo_value) warning is coming from guess_geo_type on an empty epi_df, but the concerning thing is why there's an empty edf to begin with, and that's because <yearmonth> - Inf is an NA yearmonth, leading to NA filter conditions in epix_as_of.

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 a pull request may close this issue.

2 participants