-
Notifications
You must be signed in to change notification settings - Fork 24
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
/
et al. drop class "hms"
#119
Comments
Here is a more general fix, covering base operations and summaries (like sum, min, max, range), and mean() Ops.hms <- function(e1, e2) {
res <- NextMethod(.Generic)
if (inherits(res, "difftime")) {
hms::as_hms(res)
} else {
res
}
}
Summary.hms <- function(..., na.rm) {
res <- NextMethod(.Generic)
hms::as_hms(res)
}
mean.hms <- function(x, ...) {
hms::as_hms(NextMethod(.Generic))
} |
Thanks. Is this related to #18? |
Trying to understand the neccessary test cases: Once with Is that assessment correct? |
Multiplying with and dividing by numeric or integer? Otherwise, this looks fairly complete. |
I'm having a similar problem with > max(as_hms(10))
Time difference of 10 secs
> class(max(as_hms(10)))
[1] "difftime"
> class(as_hms(10))
[1] "hms" "difftime" Would #120 fix this and what would it take to review it again? |
In #120, we need the existing tests to work. Could require changes in base R. I retriggered the test runs. |
Most computations with
hms
drop the class todifftime
causing worse UX.Created on 2023-08-18 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: