plot_sim_ts: Plot various time series from a simulation run

View source: R/plot_sim_ts.R

plot_sim_tsR Documentation

Plot various time series from a simulation run

Description

This function lets you quickly visualize the time series of output from a simulation run.

Usage

plot_sim_ts(
  x,
  pal = rev(gg_color_hue(x$n_pop)),
  years_to_show = 30,
  burn = 1:50,
  shade_years = NULL,
  adj = 0.02,
  add_units = FALSE,
  yticks = rep(list(NA), 10),
  oma = c(4, 4.5, 1, 1)
)

Arguments

x

A list output object from a simulation run of link{meta_sim}.

pal

A colour palette for the lines. One colour per line (each line is a population time series).

years_to_show

How many years to plot after the burn in period.

burn

The number of years to discard as burn in at the beginning of the time series.

shade_years

Shade some years? Give a vector. Shading will be applied from the minimum to maximum value. Can be used to show burn in period.

adj

adj parameter to pass to mtext for panel labels

add_units

Should the units be added to the y axis?

yticks

Position of ticks on the Y axis.

oma

oma vector to pass to par for outer margin space.

Value

A plot

Examples

arma_env_params <- list(mean_value = 16, ar = 0.1, sigma_env = 2, ma = 0)
base1 <- meta_sim(n_pop = 10, env_params = arma_env_params, env_type =
  "arma", assess_freq = 5, decrease_b = 10)
plot_sim_ts(base1, years_to_show = 70, burn = 1:30)

seananderson/metafolio documentation built on Feb. 13, 2024, 5:47 a.m.