Closed statquant closed 4 years ago
Thanks.
I don't think that comparison with a string is a good idea, can you parse before comparing to make it explicit?
library(hms)
as_hms("16:00:00") < as_hms("16:30:00")
#> [1] TRUE
as_hms("17:00:00") < as_hms("16:30:00")
#> [1] FALSE
Created on 2019-12-31 by the reprex package (v0.3.0)
Unfortunately, the current design makes it very difficult to preserve the "hms"
class after arithmetic operations, again you need to coerce with as_hms()
. Original issue: #18.
Hello, I can definitely make it explicit but truth is I do not really want to. I guess you're afraid people start silently to use comparison on 1000000s of items, maybe we can check for right end side to be of lenghth 1 ?
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Hello, that would be great if hms could implement comparaison with character like
Date
ornanotime
, right now it does not throw and the result is wrongThat would also be great if we could use operators - and +