% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit_rules.R
\name{audit_rules}
\alias{audit_rules}
\title{Create Data Audit Rules}
\usage{
audit_rules(
  range = NULL,
  category = NULL,
  unique = NULL,
  required = NULL,
  pattern = NULL
)
}
\arguments{
\item{range}{Named list. Each element specifies the
acceptable numeric range for a variable as a numeric
vector of length two.}

\item{category}{Named list. Each element contains the
allowed values for a variable.}

\item{unique}{Character vector containing variables that
should contain unique values.}

\item{required}{Character vector containing variables
that should not contain missing values.}

\item{pattern}{Named list. Each element specifies a
regular expression that values of a variable should
satisfy.}
}
\value{
An object of class \code{DataAuditRules}.
}
\description{
Creates a structured collection of user-defined data
validation rules for use with DataAudit.
}
\details{
\code{audit_rules()} defines validation requirements but
does not evaluate a dataset. The resulting object can be
supplied to functions that apply DataAudit rules.

Variable names are not checked against a dataset when the
rule object is created because the same rule specification
may be reused across multiple datasets.
}
\examples{
rules <- audit_rules(
  range = list(
    Age = c(0, 30),
    Weight = c(0, 100)
  ),
  category = list(
    Species = c("Dog", "Cat", "Cattle")
  ),
  unique = "Animal_ID",
  required = c("Animal_ID", "Species"),
  pattern = list(
    Animal_ID = "^A[0-9]+$"
  )
)

rules

}
