View source: R/visualize_helper.R
Datetime_limits | R Documentation |
Take a vector of Datetimes
and return the start of the first and end of the
last day of data. The start
and the length
can be adjusted by
durations
, like lubridate::ddays()
. It is used in the gg_days()
function to return a sensible x-axis. This function is a thin wrapper around
lubridate::floor_date()
and lubridate::ceiling_date()
.
Datetime_limits(
x,
start = NULL,
length = NULL,
unit = "1 day",
midnight.rollover = FALSE,
...
)
x |
a vector of |
start |
optional |
length |
optional |
unit |
a |
midnight.rollover |
a |
... |
other arguments passed to |
a 2 item vector
of Datetimes
with the (adjusted) start and end of
the input vector.
dataset <- c("2023-08-15", "2023-08-20")
breaks <- Datetime_breaks(dataset)
Datetime_limits(breaks)
Datetime_limits(breaks, start = lubridate::ddays(1))
Datetime_limits(breaks, length = lubridate::ddays(2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.