% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_msm_history.R
\name{ild_msm_history_spec}
\alias{ild_msm_history_spec}
\title{Build a declarative MSM history specification}
\usage{
ild_msm_history_spec(
  vars,
  lags = 1L,
  mode = c("gap_aware", "index", "time_window"),
  max_gap = Inf
)
}
\arguments{
\item{vars}{Character vector of variable names to lag.}

\item{lags}{Integer vector of lag orders. Recycled across \code{vars}. Defaults to \code{1L}.}

\item{mode}{Passed to [ild_lag()] (default \code{"gap_aware"}).}

\item{max_gap}{Passed to [ild_lag()] for \code{mode = "gap_aware"}.}
}
\value{
Object of class \code{ild_msm_history_spec}.
}
\description{
Creates a lightweight spec object used by [ild_build_msm_history()] to generate
lagged confounder/treatment history columns with deterministic names (e.g.
\code{stress_lag1}, \code{trt_lag2}).
}
\examples{
s <- ild_msm_history_spec(vars = c("stress", "trt"), lags = 1:2)
s
}
