% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nzv_check.R
\name{nzv_check}
\alias{nzv_check}
\title{Check Near-Zero Variance Variables}
\usage{
nzv_check(data, unique_cut = 10, freq_cut = 19)
}
\arguments{
\item{data}{A data.frame.}

\item{unique_cut}{Numeric. Maximum percentage of unique
values used to identify near-zero variance variables.
Default is 10.}

\item{freq_cut}{Numeric. Minimum frequency ratio used to
identify near-zero variance variables. Default is 19.}
}
\value{
A data.frame of class \code{NZVCheck} containing
variable-level near-zero variance diagnostics.
}
\description{
Identifies variables with zero or near-zero variance
based on the percentage of unique values and the
frequency ratio of the two most common values.
}
\details{
Missing values are excluded when calculating the number
of unique values, percentage of unique values, and
frequency ratio.

A variable is classified as having zero variance when it
contains one or fewer unique non-missing values.

A non-constant variable is classified as near-zero
variance when both:

\itemize{
\item PercentUnique is less than or equal to
\code{unique_cut}.
\item FrequencyRatio is greater than \code{freq_cut}.
}

Variables with zero variance are also flagged in the
\code{NearZeroVariance} column.
}
\examples{
dat <- data.frame(
  x = 1:100,
  y = c(rep(0, 99), 1),
  z = rep(5, 100)
)

nzv_check(dat)

nzv_check(
  dat,
  unique_cut = 20,
  freq_cut = 10
)

}
