Description Usage Arguments Details Value See Also
Create a function to turn dates into calendar periods.
1 | calendar_period(period = c("month", "quarter", "year"), start.mon = month.name)
|
period |
One of 'month' (default), 'quarter', or 'year'. |
start.mon |
In which month does a year start (default is January)? |
This function creates a simple wrapper for cut.POSIXt
.
By default it turns a date into the first day in a given calendar period, essentially rounding down dates.
Non-standard calendar periods that do not start in January (e.g., fiscal years) can be constructed by choosing a different starting month for a year with start.mon
.
This function is an alternative to some useful features in zoo
.
It is essentially creates a drop-in replacement for as.Date(as.yearmon(as.Date))
.
When dates are clustered, as in most time-series application, performance is about the same as the zoo
equivalent.
Performance can be much faster when working with microdata, and is usually slower when working with few dates that are spread out.
A function.
year_month
for an application.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.