Consider following:
library(lubridate)
period1 = weeks(2)
as.numeric(period1, "weeks")
> 2 # as expected
Now I am trying to do similar with months:
period2= months(6)
as.numeric(period2, "months")
as.numeric(period2, "weeks")
> 26.08929 # OK
as.numeric(period2,"months")
> 0.04166667 # Not OK?
Is this a bug in lubridate
? Or something wrong I am doing/missing?
Note: I have seen (old) remark Have lubridate subtraction return only a numeric value, so I guess I may also use workaround to use difftime
but I would like to stick to lubridate.