Learn R Programming

clock (version 0.7.1)

time_point_spanning_seq: 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)

Value

A sequence along [min(x), max(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.

Examples

Run this code
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)

Run the code above in your browser using DataLab