% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_residual}
\alias{geom_residual}
\title{Residual diagnostic plot}
\usage{
geom_residual(
  mapping = NULL,
  data = NULL,
  color = NULL,
  smooth = TRUE,
  size = NULL,
  alpha = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map fitted values to \code{x}
and residuals to \code{y}.}

\item{color}{Point color.}

\item{smooth}{Overlay a loess trend through the residuals.}

\item{size}{Point radius.}

\item{alpha}{Point opacity.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Residuals against fitted values with a zero reference line and a loess
trend, the first plot to look at when checking a linear model.
}
\examples{
m <- lm(dist ~ speed, cars)
d <- data.frame(fitted = fitted(m), resid = resid(m))
ggnext(d, aes(fitted, resid)) + geom_residual()
}
