Skip to contents

Create a partial timespan object

Usage

timespan(start, end, inclusive = c(TRUE, FALSE))

Arguments

start

vector of datetime objects to start timespans

end

vector of datetime objects to end timespans

inclusive

vector or matrix of logicals where each row is composed of two logical values indicating whether the timespan start and end are inclusive respectively

Value

A partial_timespan object. See Details for further information.

Details

Partial timespans are vector representations of an array of (possibly missing) datetime fields. They represent timespans while accounting for the possibility that their start and end might not be fully known. The start and end are represented similarly to partial_time objects, and represent a lower and upper bound for the timespan, and may be either inclusive or exclusive.

Internally, partial_timespan objects are represented as a three-dimensional array of partial time fields, with an added column representing whether each time is inclusive or exclusive. You may inspect this representation using vctrs::field(<tmspn>, "tmspn_arr").