% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_panel_lag_prepare.R
\name{ild_panel_lag_prepare}
\alias{ild_panel_lag_prepare}
\title{Prepare several lag columns and audit them}
\usage{
ild_panel_lag_prepare(
  data,
  variables,
  n = 1L,
  mode = c("gap_aware", "index", "time_window"),
  max_gap = NULL,
  window = NULL,
  resolution = c("closest_prior", "last_in_window", "mean_in_window")
)
}
\arguments{
\item{data}{An ILD object (see [is_ild()]).}

\item{variables}{Character vector of column names to lag.}

\item{n}{Integer vector of lag orders, recycled to \code{length(variables)}.
Ignored for \code{mode = "time_window"} (see [ild_lag()]).}

\item{mode, max_gap, window, resolution}{Passed to each [ild_lag()] call.}
}
\value{
A list with \code{data} (ILD with lag columns), \code{lag_vars}
  (names of created columns), \code{check} (tibble from [ild_check_lags()]),
  and \code{spec} (list of arguments for provenance).
}
\description{
Sequentially applies [ild_lag()] to each named variable with the same
\code{mode}, \code{max_gap}, \code{window}, and \code{resolution}, then runs
[ild_check_lags()] once on all created lag columns. Use this when building
multivariate lag specifications (e.g. several predictors or lag orders) with
consistent gap or time-window semantics.
}
\seealso{
\code{vignette("temporal-dynamics-model-choice", package = "tidyILD")},
  [ild_crosslag()], [ild_lag()].
}
