% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/target.R
\name{wf_target_reference}
\alias{wf_target_reference}
\title{Target from a weighted reference sample}
\usage{
wf_target_reference(
  ref,
  feature,
  dims,
  by = NULL,
  feature_na = c("error", "drop"),
  feature_gt1 = c("warn", "allow")
)
}
\arguments{
\item{ref}{Reference sample data frame.}

\item{feature}{Feature value column equal to \code{1 / design_weight}.}

\item{dims}{A \code{wf_dims} object.}

\item{by}{Optional grouping variable.}

\item{feature_na}{Policy for missing feature values.}

\item{feature_gt1}{Policy for feature values greater than one.}
}
\value{
A \code{wf_target} object.
}
\description{
Builds a canonical \code{wf_target} from a reference sample where \code{feature} is the
reciprocal of the design weight.
}
\examples{
dims <- wf_dims(gender = c("female", "male"))
ref <- data.frame(gender = c("female", "male"), feature = c(0.5, 0.25))
wf_target_reference(ref, "feature", dims)
}
