% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/precheck.R
\name{wf_precheck}
\alias{wf_precheck}
\title{Precheck sample and target compatibility}
\usage{
wf_precheck(
  sample,
  target,
  id = NULL,
  na = c("fractional", "drop", "error"),
  max_na_dims = 2,
  thin_min = 5,
  risk_ratio = 10
)
}
\arguments{
\item{sample}{Sample data frame.}

\item{target}{A \code{wf_target} object.}

\item{id}{Optional unique unit identifier column.}

\item{na}{Missing calibration data policy.}

\item{max_na_dims}{Maximum allowed missing calibration dimensions per row.}

\item{thin_min}{Minimum unweighted support before warning.}

\item{risk_ratio}{Target/sample share ratio warning threshold.}
}
\value{
A \code{wf_precheck} object.
}
\description{
Runs structural feasibility checks before weighting.
}
\examples{
dims <- wf_dims(gender = c("female", "male"))
pop <- data.frame(gender = c("female", "male"), count = c(55, 45))
target <- wf_target_population(pop, c(gender = "gender"), "count", dims)
sample <- data.frame(id = 1:4, gender = c("female", "male", "female", "male"))
wf_precheck(sample, target, id = "id")
}
