Expand an in-memory cohort data.frame into the sequential target-trial layout and return the result as a data.frame — the frame-in/frame-out analogue of expand_parquet(), with no intermediate Parquet.
Source: R/extendr-wrappers.R
expand_df.RdThe cohort arrives as an R data.frame (a list of equal-length columns);
columns are marshalled dtype-exactly into a Polars frame (R integer ->
Int32, double -> Float64, bit64::integer64 -> Int64), expanded by the
verified core, and the six structural columns are marshalled back to an R
data.frame. A 64-bit integer column (an integer64, e.g. a large id)
round-trips exactly via a pure-safe bit reinterpret (no precision loss).
Usage
expand_df(
cohort,
id_col,
period_col,
treatment_col,
eligible_col,
outcome_col,
first_period,
last_period,
estimand
)