reconstruct_intlen: Reconstruct intlen from time variable and stored cut points

View source: R/make-newdata.R

reconstruct_intlenR Documentation

Reconstruct intlen from time variable and stored cut points

Description

Computes interval lengths from the sorted unique values of the time variable in newdata. This is used by add_* functions that need intlen for cumulative calculations. If tstart is not available, the first interval length is taken as the first sorted time value (implicitly assuming a 0-origin time scale).

Usage

reconstruct_intlen(newdata, time_var = "tend", interval_length = "intlen")

Arguments

newdata

A data frame with a time column (default tend).

time_var

Character name of the time variable. Defaults to "tend".

interval_length

Character name of the interval-length column to create.

Value

The input data frame with an intlen column added.


pammtools documentation built on Aug. 27, 2026, 1:08 a.m.