Convert identifier columns to integer indices (1..R, 1..T, ...) used by Stan. This also creates a stable ordering of time values and optionally aggregates duplicate identifier rows.
Arguments
- data
A data.frame.
- t0
Conflict start time. May be an integer index in 1..T or a value present in
data$time.- id_cols
Identifier columns. See
vrc_validate_data().- y_col
Outcome column name.
- exposure_col
Exposure column name. If
NULL, usesexposureif present; otherwise usespop.- conflict_col
Conflict column name.
- duplicates
How to handle duplicates. One of
"error"(default) or"sum".- sort_time
Logical. If TRUE (default), time values are sorted.