Skip to contents

Configures native handling of Date, POSIXct, POSIXlt, difftime, hms, and ITime columns in synth() and synth_linked(), without requiring manual conversion to numeric.

Usage

temporal_control(
  mode = c("auto", "codec_only", "off"),
  chains = NULL,
  intervals = NULL,
  monotone = "auto",
  calendar_features = TRUE,
  snap = TRUE
)

Arguments

mode

"auto" (default) converts temporal columns losslessly, automatically detects intra-row chronological chains, longitudinal monotone trajectories, and parent-interval bounds, and adds cyclical calendar context predictors; "codec_only" preserves temporal classes and quanta without automatic chain/interval reparameterisation; "off" disables temporal encoding.

chains

Optional explicit intra-row ordering specification: a named list mapping each downstream column to its predecessor (list(discharge_date = "admit_date")) or a list of length-2 character vectors c(anchor, follower). NULL (default) auto-detects empirical a <= b ordering.

intervals

Optional explicit parent-interval mapping for child tables: a named list mapping a child temporal column to c(parent_start, parent_end). NULL (default) auto-detects empirical containment.

monotone

"auto" (default) models non-decreasing longitudinal timestamps as non-negative inter-visit waiting times; TRUE forces this for all time-varying temporal columns; FALSE disables it; or supply a character vector of column names.

calendar_features

Logical; if TRUE (default), derives transient day-of-week, month, and (for sub-day classes) diurnal predictors from temporal anchor columns so downstream variables retain calendar patterns.

snap

Logical; if TRUE (default), snaps synthesised temporal values to each column's empirical resolution quantum (e.g. whole days, hours, or minutes).

Value

An object of class temporal_control.

Examples

temporal_control(mode = "auto", calendar_features = TRUE)
#> $mode
#> [1] "auto"
#> 
#> $chains
#> NULL
#> 
#> $intervals
#> NULL
#> 
#> $monotone
#> [1] "auto"
#> 
#> $calendar_features
#> [1] TRUE
#> 
#> $snap
#> [1] TRUE
#> 
#> attr(,"class")
#> [1] "temporal_control"