Is it currently possible to suppress the message "estimate only: convert difftimes to intervals for accuracy" when executing something like the following line?
Is there a way to suppress this specific message, without suppressing more important warnings that may occur?
If not, would t be helpful if I forked lubridate and modified
this method from
setMethod("as.period", signature(x = "difftime"), function(x, unit = NULL, ...){
message("estimate only: convert difftimes to intervals for accuracy")
seconds_to_period(as.double(x, "secs"))
})
to something like
setMethod("as.period", signature(x = "difftime"), function(x, unit = NULL, showAccuracyWarning=TRUE, ...){
if( showAccuracyWarning ) message("estimate only: convert difftimes to intervals for accuracy")
seconds_to_period(as.double(x, "secs"))
})
?
To make the signatures and behavior consistent, I suppose these two lines show be modified as well.
I really like the period concept in lubridate. I deal with human age a lot, such as if kids were eligible for a specific government program during a past event. The period `10y 0m 1d` is more accurate/appropriate than dividing a difftime of 3653 days by 365.25. It's even more important when the eligibility threshold is 6 months or 34 months old.