-
Notifications
You must be signed in to change notification settings - Fork 28
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
FR: as.hms.units() #9
Comments
I now realize that |
hms wraps difftime, and so can be used for both: duration (as difference of two times) and time of day (like in |
I can see that, but that is not how the hms package explains what hms values mean. So: syntactically yes, semantically no, and measurement units are about meaning. Subclassing time-of-day from a time duration class is a conceptual mistake: is 12:00:00 twice as late as 06:00:00? hms thinks so:
This should of course have triggered an error. |
Thanks, I shall adapt the README then. The hms class doesn't specify preferred usage, it's just a container with nice formatting intended to be compatible to difftime. See tidyverse/hms#18 for the conversion issue. |
The better fix would be to make |
O.K., you clarified that the meaning of hms
Since this cannot be be converted unambiguously in an SI unit of time duration (as package |
Simply
as.hms.units <- function(x, ...) as.hms(as.dt(x, ...))
, but probably needs to importhms
.The text was updated successfully, but these errors were encountered: