duration_spanning_seq: Spanning sequence: duration

View source: R/duration.R

duration_spanning_seqR Documentation

Spanning sequence: duration

Description

duration_spanning_seq() generates a regular sequence along the span of x, i.e. along ⁠[min(x), max(x)]⁠.

Usage

duration_spanning_seq(x)

Arguments

x

⁠[clock_duration]⁠

A duration 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 <- duration_days(c(1, 5, 2))
duration_spanning_seq(x)

# Missing values are removed before the sequence is created
x <- vctrs::vec_c(NA, x, NA)
duration_spanning_seq(x)

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