powered by
This is a year-day method for the calendar_group() generic.
calendar_group()
Grouping for a year-day object can be done at any precision, as long as x is at least as precise as precision.
x
precision
# S3 method for clock_year_day calendar_group(x, precision, ..., n = 1L)
x grouped at the specified precision.
[clock_year_day]
A year-day vector.
[character(1)]
One of:
"year"
"day"
"hour"
"minute"
"second"
"millisecond"
"microsecond"
"nanosecond"
These dots are for future extensions and must be empty.
[positive integer(1)]
A single positive integer specifying a multiple of precision to use.
x <- seq(as_naive_time(year_month_day(2019, 1, 1)), by = 5, length.out = 20) x <- as_year_day(x) x # Group by day of the current year calendar_group(x, "day", n = 20)
Run the code above in your browser using DataLab