Internal helper used by .apply_regime_filter() to coerce a
heterogeneous regime argument (NULL, Date scalar/vector,
character coercible to Date, or a Regime object) into either a
single Date scalar or a per-group data.table keyed by the
caller-supplied by columns.
Arguments
- regime
- by
Optional character vector of group columns the caller wants the change date dispatched on. When
NULL(default) or empty, the function always returns a scalar (the maximum change date), preserving the historical single-value contract. When non-empty andregimeis a multi-groupRegimewhose$groupsintersectby, returns adata.tablewith[intersect(by, regime$groups)..., change_date](one row per group combo, holdingmax(change)). Otherwise falls back to scalar.
