date_group {clock} | R Documentation |
Group date and date-time components
Description
date_group()
groups by a single component of a date-time, such as month
of the year, or day of the month.
There are separate help pages for grouping dates and date-times:
Usage
date_group(x, precision, ..., n = 1L)
Arguments
x |
A date or date-time vector. |
precision |
A precision. Allowed precisions are dependent on the input used. |
... |
These dots are for future extensions and must be empty. |
n |
A single positive integer specifying a multiple of |
Value
x
, grouped at precision
.
Examples
# See type specific documentation for more examples
date_group(as.Date("2019-01-01") + 0:5, "day", n = 2)
[Package clock version 0.7.1 Index]