time_delta_to_n_steps: Convert a time delta to a integerish number of "unit" steps...

View source: R/time-utils.R

time_delta_to_n_stepsR Documentation

Convert a time delta to a integerish number of "unit" steps between time values

Description

Convert a time delta to a integerish number of "unit" steps between time values

Usage

time_delta_to_n_steps(time_delta, time_type)

Arguments

time_delta

a vector that can be added to time values of time type time_type to arrive at other time values of that time type, or [Experimental] such a vector with Inf/-Inf entries mixed in, if supported by the class of time_delta, even if time_type doesn't necessarily support Inf/-Inf entries. Basically a slide window arg but without sign and length restrictions.

time_type

as in validate_slide_window_arg

Value

bare integerish vector (with possible infinite values) that produces the same result as time_delta when multiplied by the natural unit_time_delta for that time type and added to time values of time type time_type. If the given time type does not support infinite values, then it should produce +Inf or -Inf for analogous entries of time_delta, and match the addition result match the addition result for non-infinite entries.


cmu-delphi/epiprocess documentation built on Feb. 22, 2025, 9:26 a.m.