I'm getting unexpected output from the all.equal method in R, specifically the implementation for POSIXct, all.equal.POSIXct.
t <- Sys.time()
isTRUE(all.equal(t, t+1))
returns TRUE, and
isTRUE(all.equal(t, t+1, scale = 1))
returns FALSE.
However, if you look at the definition of all.equal.POSIXct, you can see that the scale parameter has a default of 1:
> all.equal.POSIXct
function (target, current, ..., scale = 1)
{
check_tzones(target, current)
NextMethod("all.equal")
}
<bytecode: 0x22eac90>
<environment: namespace:base>
You get the same results if you explicitly call all.equal.POSIXct instead of all.equal.
Why isn't the default parameter scale = 1 being picked up in the first call to all.equal.POSIXct? Am I doing something wrong, or have I fundamentally misunderstood something, or is this a bug?
Thanks in advance for any help.