plot_historical_ts: Plot historical time series

View source: R/figures-historical.R

plot_historical_tsR Documentation

Plot historical time series

Description

Plot historical time series

Usage

plot_historical_ts(
  object,
  type = c("Number", "Biomass", "VBiomass", "SBiomass", "Removals", "Landings",
    "Discards", "Find", "RecDev", "Unfished_Equilibrium"),
  n_samples = 50,
  this_year = 2018,
  observed_ts = NULL,
  scale = if (!is.null(observed_ts)) TRUE else FALSE,
  legend_position = c(0.9, 0.85)
)

Arguments

object

A MSEtool object of class Hist that was created by running MSEtool::runMSE() with Hist = TRUE.

type

A character object describing the element of object@TSdata to plot.

n_samples

The number of timeseries samples to illustrate.

this_year

The last year of the historical timeseries.

observed_ts

An optional observed timeseries to add is a comparison.

scale

Should the timeseries be scaled by their geometric mean?

legend_position

The x and y coordinates of the legend.

Value

ggplot object

Examples

library(MSEtool)
historical_mse <- runMSE(om, Hist = TRUE)
plot_historical_ts(historical_mse, type = "Removals", n_samples = 2)
plot_historical_ts(historical_mse, type = "SBiomass", n_samples = 2)
plot_historical_ts(historical_mse, type = "RecDev", n_samples = 2)
plot_historical_ts(historical_mse,
  n_samples = 2,
  observed_ts = rlnorm(50, 1, 0.3)
)

pbs-assess/ggmse documentation built on Nov. 21, 2023, 8:06 p.m.