Open dpranjic-r opened 10 months ago
It should be a new function, multimester
or varimester
, something that would accept a range of months, in your example c(1, 5, 8)
.
Right now you can floor_date
to a date vector (unit
argument). So you can construct a vector of 1st
of Januarys, Mays, and Augusts and round to those.
Something like this:
> y <- today() + months(1:20)
> month(
+ floor_date(
+ update(y, year = 2000),
+ ISOdate(year = 2000, month = c(1, 5, 8), day = 1)
+ ))
## [1] 8 8 8 1 1 1 1 5 5 5 8 8 8 8 8 1 1 1 1 5
I would consider a PR for the implementation of varimester
Currently, the
semester()
accessor function fromlubridate
does not have an option for more than two semesters per year. It would be helpful if the function offered the option to set the number of semesters and start dates, or at the very least offer a trimester option, with the spring, summer, and fall semesters starting on January 1, May 1, and August 1 (typical start dates at large state universities). Thank you for your time and consideration.