% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_dendrogram}
\alias{geom_dendrogram}
\title{Hierarchical clustering dendrogram}
\usage{
geom_dendrogram(
  data,
  vars = NULL,
  method = "complete",
  color = NULL,
  linewidth = NULL
)
}
\arguments{
\item{data}{A data frame with one row per observation to cluster.}

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

\item{method}{Linkage method, passed to \code{\link[stats:hclust]{stats::hclust()}} (default
\code{"complete"}).}

\item{color, linewidth}{Line appearance.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Runs \code{\link[stats:hclust]{stats::hclust()}} (base R, not an added dependency) on the
Euclidean distances between rows of \code{data} and draws the merge tree as
the classic bracket shape: two vertical drops joined by one horizontal
bar at the merge height. Takes the raw wide data frame directly (like
\code{\link[=geom_cor]{geom_cor()}}), since the layout needs the whole numeric block at once,
not row-wise aesthetics.
}
\examples{
ggnext() +
  geom_dendrogram(mtcars[1:10, c("mpg", "hp", "wt", "qsec")]) +
  theme_void()
}
