View source: R/figures-historical.R
plot_historical_ts | R Documentation |
Plot historical time series
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)
)
object |
A MSEtool object of class |
type |
A character object describing the element of |
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. |
ggplot object
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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.