format_time_delta: Format a length-1 time delta to a character to assist...

View source: R/time-utils.R

format_time_deltaR Documentation

Format a length-1 time delta to a character to assist messaging

Description

This is meant to address the following:

  • glue::glue("{as.difftime(1, units = 'days')}") is "1"

  • glue::glue("{format(as.difftime(1, units = 'days'))}") is "1 days"

  • time deltas for yearmonths and integers don't have units attached at all

Usage

format_time_delta(x, time_type)

cmu-delphi/epitools documentation built on April 17, 2025, 3:33 a.m.