Skip to contents

Construction and Casting

phinterval()
Create a new phinterval
hole()
Create a hole phinterval
as_phinterval()
Convert an interval or datetime vector into a phinterval
as_duration()
Convert a phinterval to a duration

Set Operations

Modifications

phint_invert()
Get the gaps in a phinterval as time spans
phint_discard_instants()
Remove instantaneous time spans from a phinterval

Transformations

phint_squash() datetime_squash() phint_squash_by() datetime_squash_by()
Squash overlapping intervals into non-overlapping spans

Relations and Predicates

phint_overlaps()
Test whether two phintervals overlap
phint_within()
Test whether a datetime or phinterval is within another phinterval
is_hole() is_span() is_disjoint()
Test for empty, contiguous, or disjoint intervals
is_phinterval()
Test if the object is a phinterval
is_phintish()
Test if the object is a phinterval or interval

Accessors

phint_unnest()
Unnest a phinterval into a data frame
phint_start() phint_end() phint_starts() phint_ends()
Accessors for the endpoints of a phinterval
phint_length() phint_lengths()
Compute the length of a phinterval in seconds
n_spans()
Count the number of spans in a phinterval

Time Zone

is_recognized_tzone()
Test if the object is a recognized time zone

Package Options

phinterval_options
Package options

Re-Exports

reexports interval duration POSIXct NA_POSIXct_ tzdb_names tzdb_version
Objects exported from other packages

Under Development

These functions are currently only available in the development version of {phinterval} and are not yet stable. You can install the development version from GitHub using pak::pak("EthanSansom/phinterval").

phint_cumunion() phint_cumintersect()
Cumulative set operations
phint_flatten() datetime_flatten()
Flatten a phinterval vector into a vector of spans or gaps
phint_sift()
Keep or discard spans by duration
phint_unoverlap()
Resolve overlapping intervals sequentially or by priority
phint_has_overlaps() phint_any_overlaps()
Test whether a phinterval vector has cross-element overlaps