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/epiprocess documentation built on Feb. 22, 2025, 9:26 a.m.