time_point_spanning_seq: Spanning sequence: time points

View source: R/time-point.R

time_point_spanning_seqR Documentation

Spanning sequence: time points

Description

time_point_spanning_seq() generates a regular sequence along the span of x, i.e. along ⁠[min(x), max(x)]⁠. The sequence is generated at the precision of x.

Usage

time_point_spanning_seq(x)

Arguments

x

⁠[clock_sys_time / clock_naive_time]⁠

A time point vector.

Details

Missing values are automatically removed before the sequence is generated.

If you need more precise sequence generation, call range() and seq() directly.

Value

A sequence along ⁠[min(x), max(x)]⁠.

Examples

x <- as_naive_time(year_month_day(2019, c(1, 2, 1, 2), c(15, 4, 12, 2)))
x

time_point_spanning_seq(x)

# The sequence is generated at the precision of `x`
x <- as_naive_time(c(
  year_month_day(2019, 1, 1, 5),
  year_month_day(2019, 1, 2, 10),
  year_month_day(2019, 1, 1, 3)
))
time_point_spanning_seq(x)

clock documentation built on Sept. 11, 2024, 8:39 p.m.