You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Thank you. Perhaps you can add a comment somewhere that for conversion you
need as.numeric(as.duration(i1), units = "days")
or as.numeric(i1, units = 'days') # Throwing a message on my computer - I don't know the reason.
I could not find it in the descrition nor in the article "Dates and Times
Made Easy with lubridate"...
Hm. I am starting thinking this was a mistake. There might be plenty of derived classes from numeric that are valid inputs into duration constructor. The fact that lubridate's interval and period inherit from numeric was a mistake. It might be changed some day.
I am replacing this change with a much weaker check for "Period" and "Interval" class.