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
Whilst uncommon, it believe it should be possible to have a period with an infinite value (which when applied to a date with an operation, should result in an infinite date). Currently there is some code in periods.r which prevents this from being a possibility:
if (sum(values- trunc(values))) {
msg<-"periods must have integer values"errors<- c(errors, msg)
}
Reprex:
lubridate::today() +Inf#> [1] "Inf"lubridate::today() +lubridate::days(Inf)
#> Error in if (sum(values - trunc(values))) {: argument is not interpretable as logical
I should note, the reason I am doing this is in a dplyr::mutate I need to add a number of days to a date to determine a deadline: Inf is used to specify that there is no deadline, whereas NA is used to specify that no deadline has been specified yet
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I have fixed the error but the actual computation has to be fixed in vspinu/timechange#29 For now you will get the NA instead of the Inf date.
Version 1.9.3
=============
### NEW FEATURES
* [#682](tidyverse/lubridate#682 (comment))
Add type="year_start/end" argument to `quarter()` which produces
a complete description of the quarter.
### BUG FIXES
* [#1109](tidyverse/lubridate#1109)
Fix recycling of the year slot in `as.period(unit = "month")` with Periods and Intervals.
* [#1133](tidyverse/lubridate#1133)
Don't error on addition on infinite periods.
Whilst uncommon, it believe it should be possible to have a period with an infinite value (which when applied to a date with an operation, should result in an infinite date). Currently there is some code in periods.r which prevents this from being a possibility:
https://github.com/tidyverse/lubridate/blob/cae67eaee701f5041425968fc2a838e9fa25ed19/R/periods.r#L29C1-L32C4
Reprex:
I should note, the reason I am doing this is in a dplyr::mutate I need to add a number of days to a date to determine a deadline: Inf is used to specify that there is no deadline, whereas NA is used to specify that no deadline has been specified yet
The text was updated successfully, but these errors were encountered: