We currently get a once per session warning with subtraction when you have two Period or two Duration objects. This is because we have a method for <ANY> - <Period> and <Period> - <ANY> and it doesn't know which to choose.
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
x <- years(4)
y <- dyears(4)
x - x
#> Note: method with signature 'Period#ANY' chosen for function '-',
#> target signature 'Period#Period'.
#> "ANY#Period" would also be valid
#> [1] "0S"
x - x
#> [1] "0S"
y - y
#> Note: method with signature 'Duration#ANY' chosen for function '-',
#> target signature 'Duration#Duration'.
#> "ANY#Duration" would also be valid
#> [1] "0s"
y - y
#> [1] "0s"
Created on 2021-09-21 by the reprex package (v2.0.0.9000)
We currently get a once per session warning with subtraction when you have two Period or two Duration objects. This is because we have a method for
<ANY> - <Period>and<Period> - <ANY>and it doesn't know which to choose.Created on 2021-09-21 by the reprex package (v2.0.0.9000)