% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/equals_na_linter.R
\name{equals_na_linter}
\alias{equals_na_linter}
\title{Equality check with NA linter}
\usage{
equals_na_linter()
}
\description{
Check for \code{x == NA}, \code{x != NA} and \code{x \%in\% NA}. Such usage is almost surely incorrect --
checks for missing values should be done with \code{\link[=is.na]{is.na()}}.
}
\examples{
# will produce lints
lint(
  text = "x == NA",
  linters = equals_na_linter()
)

lint(
  text = "x != NA",
  linters = equals_na_linter()
)

lint(
  text = "x \%in\% NA",
  linters = equals_na_linter()
)

# okay
lint(
  text = "is.na(x)",
  linters = equals_na_linter()
)

lint(
  text = "!is.na(x)",
  linters = equals_na_linter()
)

}
\seealso{
\link{linters} for a complete list of linters available in lintr.
}
\section{Tags}{
\link[=common_mistakes_linters]{common_mistakes}, \link[=correctness_linters]{correctness}, \link[=default_linters]{default}, \link[=robustness_linters]{robustness}
}
