powered by
brk_width() can be used with time interval classes from base R or the lubridate package.
brk_width()
lubridate
# S3 method for Duration brk_width(width, start)
A scalar difftime, Period or Duration object.
A scalar of class Date or POSIXct. Can be omitted.
If width is a Period, lubridate::add_with_rollback() is used to calculate the widths. This can be useful for e.g. calendar months.
width
lubridate::add_with_rollback()
if (requireNamespace("lubridate")) { year2001 <- as.Date("2001-01-01") + 0:364 tab_width(year2001, months(1), labels = lbl_discrete(" to ", fmt = "%e %b %y")) }
Run the code above in your browser using DataLab