brk_width-for-datetime {santoku} | R Documentation |
Equal-width intervals for dates or datetimes
Description
brk_width()
can be used with time interval classes from base R or the
lubridate
package.
Usage
## S3 method for class 'Duration'
brk_width(width, start)
Arguments
width |
|
start |
Details
If width
is a Period, lubridate::add_with_rollback()
is used to calculate the widths. This can be useful for e.g. calendar months.
Examples
if (requireNamespace("lubridate")) {
year2001 <- as.Date("2001-01-01") + 0:364
tab_width(year2001, months(1),
labels = lbl_discrete(" to ", fmt = "%e %b %y"))
}
[Package santoku version 1.0.0 Index]