% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_prepare.R
\name{build_id_map}
\alias{build_id_map}
\title{Build a mapping from panel unit IDs to spatial row indices}
\usage{
build_id_map(panel_data, spatial_data, id)
}
\arguments{
\item{panel_data}{A data frame with a column named `id`.}

\item{spatial_data}{An `sf` data frame with a column named `id`.}

\item{id}{Character; name of the shared ID column.}
}
\value{
Named integer vector mapping unit ID to spatial row index.
}
\description{
Returns a named integer vector where each name is a panel unit ID (as a
character string) and each value is the corresponding row index in
`spatial_data` (1-based).
}
\details{
Rules:
- Every panel ID must have a spatial match; missing IDs cause an error.
- Extra spatial rows (not in panel) are silently ignored.
}
\keyword{internal}
