% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dependency_check.R
\name{dependency_check}
\alias{dependency_check}
\title{Check Conditional Variable Dependency}
\usage{
dependency_check(
  data,
  condition_variable,
  condition_value,
  target_variable,
  allow_blank = FALSE
)
}
\arguments{
\item{data}{A data.frame.}

\item{condition_variable}{A single character string
specifying the variable defining the condition.}

\item{condition_value}{The value of \code{condition_variable}
that activates the dependency rule.}

\item{target_variable}{A single character string specifying
the variable that is required when the condition is met.}

\item{allow_blank}{Logical. If FALSE, blank character values
in the target variable are treated as missing. Default is
FALSE.}
}
\value{
A data.frame of class \code{DependencyCheck}
containing row-level dependency diagnostics.
}
\description{
Checks whether a target variable satisfies a requirement
when a specified condition is met in another variable.
}
\details{
The dependency rule is interpreted as:

If \code{condition_variable == condition_value}, then
\code{target_variable} must contain an acceptable value.

Missing values in the condition variable do not activate
the dependency rule.

When \code{allow_blank = FALSE}, empty strings and strings
containing only whitespace are treated as unavailable target
values.

The function does not modify the original data.
}
\examples{
dat <- data.frame(
  Disease_Status = c(
    "Positive",
    "Negative",
    "Positive",
    "Positive"
  ),
  Test_Result = c(
    "PCR positive",
    NA,
    NA,
    "Detected"
  )
)

dependency_check(
  dat,
  condition_variable = "Disease_Status",
  condition_value = "Positive",
  target_variable = "Test_Result"
)

}
