% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-base.R
\name{geom_missing_pattern}
\alias{geom_missing_pattern}
\title{Missing-data pattern plot}
\usage{
geom_missing_pattern(
  data,
  vars = NULL,
  label = TRUE,
  label_size = NULL,
  observed = "#D8DCE6",
  missing = "#C1462F"
)
}
\arguments{
\item{data}{A data frame to check for missing values.}

\item{vars}{Character vector of columns to include; default all columns
in \code{data}.}

\item{label}{Annotate missing cells.}

\item{label_size}{Annotation text size in px.}

\item{observed, missing}{Tile fill colors for observed vs. missing cells.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
A tile grid of which variables are observed vs. missing, one row per
\emph{distinct missingness pattern} (most frequent at the top, annotated
with how many observations share it) rather than one row per
observation — the standard compact view for spotting structured
missingness (e.g. a block of variables always missing together).
}
\examples{
d <- data.frame(
  age = c(25, NA, 30, 40, NA, 33),
  bmi = c(22, 24, NA, NA, 27, 23),
  sbp = c(120, 118, 130, NA, 125, 121)
)
ggnext() + geom_missing_pattern(d) + labs(title = "Missing-data patterns")
}
