% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats.clim.twd.R
\name{plot.clim_twd_stats}
\alias{plot.clim_twd_stats}
\title{Plot method for clim.twd.stats output}
\usage{
\method{plot}{clim_twd_stats}(
  x,
  y = NULL,
  type = c("trajectory", "id_metric"),
  ids = NULL,
  groups = NULL,
  band = c("none", "sd", "limit95", "both"),
  metric = c("lag_to_below_zero", "lag_to_max_adverse_decline", "lag_to_return_zero",
    "max_adverse_decline_value", "change_end_adverse", "change_end_full_period",
    "continuous_end_full_period"),
  facet_by = c("IDs", "group", "none"),
  legend_position = "bottom",
  main = NULL,
  ...
)
}
\arguments{
\item{x}{An object of class \code{"clim_twd_stats"}.}

\item{y}{Unused.}

\item{type}{One of \code{"trajectory"} or \code{"id_metric"}.}

\item{ids}{Optional numeric vector of IDs to plot.}

\item{groups}{Optional character vector of group labels to plot.}

\item{band}{One of \code{"none"}, \code{"sd"}, \code{"limit95"}, or \code{"both"}.
Used for \code{type = "trajectory"}.}

\item{metric}{Metric column from \code{x$id_summary} for \code{type = "id_metric"}.}

\item{facet_by}{One of \code{"IDs"}, \code{"group"}, or \code{"none"}.}

\item{legend_position}{Legend position.}

\item{main}{Optional title.}

\item{...}{Further arguments passed to or from other methods.}
}
\value{
A \code{ggplot2} object.
}
\description{
Plots grouped trajectories or grouped ID-level metrics from
\code{clim.twd.stats()}.
}
