year-quarter-day-group {clock} | R Documentation |
This is a year-quarter-day method for the calendar_group()
generic.
Grouping for a year-quarter-day object can be done at any precision, as
long as x
is at least as precise as precision
.
## S3 method for class 'clock_year_quarter_day' calendar_group(x, precision, ..., n = 1L)
x |
A year-quarter-day vector. |
precision |
One of:
|
... |
These dots are for future extensions and must be empty. |
n |
A single positive integer specifying a multiple of |
x
grouped at the specified precision
.
x <- year_quarter_day(2019, 1:4) x <- c(x, set_year(x, 2020)) # Group by 3 quarters # Note that this is a grouping of 3 quarters of the current year # (i.e. the count resets at the beginning of the next year) calendar_group(x, "quarter", n = 3) # Group by 5 days of the current quarter y <- year_quarter_day(2019, 1, 1:90) calendar_group(y, "day", n = 5)