% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-statevar.R
\name{compare_statevar_ts}
\alias{compare_statevar_ts}
\alias{compare_statevar_hist}
\title{Compare state variables from simulation runs}
\usage{
compare_statevar_ts(
  SMSE_list,
  var = "PNI",
  s = 1,
  figure = TRUE,
  xlab = "Projection Year",
  quant = FALSE,
  ylab = var,
  ylim,
  agg.fun = sum,
  names,
  col_vec,
  ...
)

compare_statevar_hist(
  SMSE_list,
  var = "PNI",
  s = 1,
  y,
  figure = TRUE,
  xlab = var,
  names,
  col_vec,
  type = c("density", "hist"),
  ...
)
}
\arguments{
\item{SMSE_list}{List of SMSE objects for multiple model runs returned by \code{\link[=salmonMSE]{salmonMSE()}}}

\item{var}{Character. Slot for the state variable in \code{SMSE} object. See \code{slotNames(SMSE)} for options. Additional supported options are:
\code{"ESS"} (egg-smolt survival), \code{"pbrood"} (broodtake to escapement ratio), \code{"pNOSesc"} (NOS/natural escapement), \code{"pHOSesc"} (HOS/hatchery escapement),
\verb{Total Spawners} (NOS + HOS), \code{NOS/SMSY}, \code{S/SMSY}, and \code{NOS/Sgen}.}

\item{s}{Integer. Population index for multi-population model (e.g., \code{s = 1} is the first population in the model)}

\item{figure}{Logical, whether to generate a figure (set to FALSE if only using the function to return the data matrix)}

\item{xlab}{Character. Name of time variable for the figure}

\item{quant}{Logical, whether to plot individual simulations (FALSE) or the median with 95 percent confidence intervals (TRUE)}

\item{ylab}{Character. Name of the state variable for the figure}

\item{ylim}{Vector. Y-axis limits}

\item{agg.fun}{Function. Defines how to aggregate state variables that are reported by age. Typically, \code{sum} is used but \code{max} is also
possible for reporting apical exploitation rates.}

\item{names}{Character vector \code{length(SMSE_list)} to label individual model runs}

\item{col_vec}{Character vector \code{length(SMSE_list)} for custom colour schemes for comparing across model scenarios in figures}

\item{...}{Additional arguments to base plot function}

\item{y}{Integer. Projection year for the state variable to plot the histogram. If missing, the last projection year is used.}

\item{type}{Character, whether to generate a density figure or histogram}
}
\value{
An array invisibly. Also generates base graphics if \code{figure = TRUE}
}
\description{
Compare outputs from multiple simulations to evaluate performance across states of nature and/or management levers (identified by colour):
\itemize{
\item \code{compare_statevar_ts()} produces a time series for all simulations, or with medians and 95th percentile intervals
\item \code{compare_statevar_hist()} produces a histogram or density plot across all simulations for a particular year
}
}
\seealso{
\code{\link[=plot_statevar_ts]{plot_statevar_ts()}} \code{\link[=compare]{compare()}}
}
