-
Notifications
You must be signed in to change notification settings - Fork 215
Closed
Description
See 🔗 Stack Overflow question.
In a nutshell, the following code
time = now()
five_sec = interval(time, time + 5)
duration(five_sec)
# [1] "5s"
duration(five_sec, units = 'days')
# [1] "432000s (~5 days)"Yields an unexpected output for the last line because the class of five_sec is ignored, and its unit is overridden to be interpreted as days. This makes sense for a unitless num argument — but five_sec isn’t unitless by virtue of being an Interval.
The expected behaviour is that this should be disallowed — i.e. throw an error, or at least signal a stern warning that the interval’s unit is being ignored.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels