% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-clinical.R
\name{geom_spaghetti}
\alias{geom_spaghetti}
\title{Individual longitudinal trajectories (spaghetti plot)}
\usage{
geom_spaghetti(
  mapping = NULL,
  data = NULL,
  mean_line = TRUE,
  alpha = NULL,
  linewidth = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map time to \code{x}, the
measurement to \code{y}, and the subject to \code{group}.}

\item{mean_line}{Overlay the group mean trajectory.}

\item{alpha}{Opacity of the individual lines.}

\item{linewidth}{Width of the individual lines.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
One thin line per subject with an optional bold group mean overlaid —
the standard way to show within-subject change without hiding spread.
}
\examples{
set.seed(1)
d <- data.frame(
  week = rep(0:4, 8), id = rep(1:8, each = 5),
  score = as.vector(sapply(1:8, function(i) 50 + i + (0:4) * 2 + rnorm(5, 0, 3)))
)
ggnext(d, aes(week, score, group = id)) + geom_spaghetti()
}
