Skip to contents

phinterval (development version)

Features

Bug fixes

  • phint_setdiff() no longer returns a malformed phinterval when phint2 contains instants (#3).

  • phint_invert() no longer returns a malformed phinterval when phint contains instants (#9).

Breaking changes

  • phint_unnest() now always returns a dataframe with columns key, start, end, and size, instead of optionally including a size column.

The keep_size argument has been removed from phint_unnest() and the function signature has been revised:

# Old Usage
phint_unnest(phint, hole_to = c("drop", "na"), keep_size = FALSE, key = NULL)

# New Usage
phint_unnest(phint, key = NULL, hole_to = c("na", "drop"))

The return type of the *_squash() variants is now always a scalar <phinterval> vector, meaning it is safe to use within dplyr::summarize(). This includes cases where the phint argument of phint_squash() or the start, end arguments of datetime_squash() are empty as the empty_to = "empty" option has been removed from the empty_to argument.

The return type of the *_squash_by() variants is now always a tibble() with columns by and phint. Additionally, the keep_by argument has been removed from these variants.

# Old Usage
phint_squash(
  phint,
  by = NULL,
  na.rm = TRUE,
  empty_to = c("hole", "na", "empty"),
  order_by = FALSE,
  keep_by = FALSE
)

# New Usage
phint_squash(
  phint,
  na_rm = TRUE,
  empty_to = c("hole", "na")
)

phint_squash_by(
  phint,
  by,
  na_rm = TRUE,
  empty_to = c("hole", "na"),
  order_by = TRUE
)
  • phint_sift() now has additional arguments min_length, max_length, and action.

    • The previous version of phint_sift() (usage phint_sift(phint)) was re-named to phint_discard_instants().

    • Calling phint_sift(phint) without additional arguments now raises an error.

phinterval 1.0.0

CRAN release: 2026-02-03

  • Initial CRAN submission.