brk_width-for-datetime | R Documentation |
brk_width()
can be used with time interval classes from base R or the
lubridate
package.
## S3 method for class 'Duration'
brk_width(width, start)
width |
A scalar difftime, Period or Duration object. |
start |
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.
if (requireNamespace("lubridate")) {
year2001 <- as.Date("2001-01-01") + 0:364
tab_width(year2001, months(1),
labels = lbl_discrete(" to ", fmt = "%e %b %y"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.