tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
531 stars 49 forks source link

Filtering "yearmonth" with a dates causes a warning #200

Closed markfairbanks closed 4 years ago

markfairbanks commented 4 years ago

Filtering a column of class "yearmonth" using a date filter now causes a warning. It still seems to work, but the warning is new:

library(fpp3)

test_df <- tibble(index = yearmonth(ymd(20200101) + months(0:1)))

test_df %>%
  filter(index < ymd(20200201))
#> Warning in mask$eval_all_filter(dots, env_filter): Incompatible methods
#> ("<.vctrs_vctr", "<.Date") for "<"
#> # A tibble: 1 x 1
#>      index
#>      <mth>
#> 1 2020 Jan
earowang commented 4 years ago

Yep, it's new, and now comparisons between different objects (yearmonth and Date) are no longer encouraged. Since v0.9.0, tsibble shifts to a more robust framework (vctrs) that underlies these classes.

Cheers, Earo

On 25 Jun 2020, at 15:30, Mark Fairbanks wrote:

Filtering a column of class "yearmonth" using a date filter now causes a warning. It still seems to work, but the warning is new:

library(fpp3)

test_df <- tibble(index = yearmonth(ymd(20200101) + months(0:1)))

test_df %>%
  filter(index < ymd(20200201))
#> Warning in mask$eval_all_filter(dots, env_filter): Incompatible 
methods
#> ("<.vctrs_vctr", "<.Date") for "<"
#> # A tibble: 1 x 1
#>      index
#>      <mth>
#> 1 2020 Jan

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/tidyverts/tsibble/issues/200

markfairbanks commented 4 years ago

Gotcha, makes sense. Thanks for the help