Closed Moohan closed 3 years ago
@Tina815 and @jackhannah95 wrote the original function(s).
@davidc92 Just continuing the chat from #48 here as if I make the change you suggested last I'll start a new PR.
Yes, the issue is just that the error checking in the qtr_
functions is too strict, but I thought a new function was the best option as without it the check code is repeated quite a lot. The other advantage of a separate function is that it can be tested independently.
Currently, the
qtr_
functions will only accept a date variable if it is specifically the lubridateDate
class this is more restrictive than thefin_year
function, which also accepts dates ofPOSIXct
class. This is a bit confusing when you can possibly use one function on a date column but not another function.I don't see any reason why
qtr_
can't take aPOSIXct
class date column so I suggest making that change, might be nice to create a util functionis_date
which can be used by all other functions.