I was wondering if it is possible to add a with_year option to the month function in lubridate.
The quarter and semester functions both have a with_year option, for example:
require(lubridate)
x <- ymd(c("2012-03-26", "2012-05-04", "2012-09-23", "2012-12-31"))
quarter(x, with_year = TRUE)
would get me:
[1] 2012.1 2012.2 2012.3 2012.4
which is very nice to use in terms of merging purpose
I wish the month function have this feature so I do not have to resort to the yearmon function in zoo. It is really an important feature for financial data analysis, and I prefer to use packages in the Hadleyverse.