yearmonth equality is only achieved when the same dates were used to create those objects. I would expect that two yearmonths are equal when they represent the same month and not rely on some underlying data representation.
See the example below - I would expect that x and y are equal.
library(tsibble)
library(testthat)
x <- yearmonth("2020-01-01")
y <- yearmonth("2020-01-02")
x == y
#> [1] FALSE
expect_equal(x, y)
#> Error: `x` not equal to `y`.
#> Mean relative difference: 5.475851e-05
Created on 2020-10-09 by the reprex package (v0.3.0)
tsibble_0.9.3 - dev version from Github.
yearmonth
equality is only achieved when the same dates were used to create those objects. I would expect that two yearmonths are equal when they represent the same month and not rely on some underlying data representation.See the example below - I would expect that
x
andy
are equal.Created on 2020-10-09 by the reprex package (v0.3.0) tsibble_0.9.3 - dev version from Github.