date_spanning_seq | R Documentation |
date_spanning_seq()
generates a regular sequence along the span of
x
, i.e. along [min(x), max(x)]
. For dates, this generates a day precision
sequence, and for date-times it generates a second precision sequence.
date_spanning_seq(x)
x |
A date or date-time vector. |
Missing and infinite values are automatically removed before the sequence is generated.
For date-times, sys-time based sequences are generated, consistent with
date_seq()
when using a second precision by
value.
If you need more precise sequence generation, call range()
and date_seq()
directly.
A sequence along [min(x), max(x)]
.
x <- date_build(2020, c(1, 2, 1), c(10, 5, 12))
date_spanning_seq(x)
# Missing and infinite dates are removed before the sequence is generated
x <- c(x, NA, Inf, -Inf)
x
date_spanning_seq(x)
# For date-times, sequences are generated at second precision
x <- date_time_build(
2020, 1, 2, 3, c(5, 4, 5), c(10, 48, 12),
zone = "America/New_York"
)
x
date_spanning_seq(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.