A function to plot delta and size vs time from the sim.scenario runs and to include observations along simulations.

plot_scenario(
  workdir,
  scenario_dir_name,
  shown_runs = NULL,
  time_unit = NULL,
  hidden_boxes = NULL,
  return_as_print = TRUE,
  show.facets = FALSE,
  show.run_separations = TRUE,
  observations_file = NULL,
  observations_groups = NULL
)

Arguments

workdir

Working directory of isobxr excel master file and where output files will be stored if exported by user. (character string)

scenario_dir_name

name of sim.scenario SERIES directory (starts with 3_SCEN)

shown_runs

Vector of successive run numbers (RUN_n) to be displayed (e.g., 1:5).
Default is run 2 to last run (hides initial relaxation run)

time_unit

Time unit to use on plot if different from native time unit.
Character string, to be selected among the following:
micros, ms, s, min, h, d, wk, mo, yr, kyr, Myr, Gyr
Default is NULL.

hidden_boxes

List of boxes to hide from plots, as a vector of character strings.
For instance c("SOURCE", "SINK").

return_as_print

If TRUE, prints delta and size vs. time plots in a single page figure on R.
If FALSE, returns separately delta and size vs. time plots as list of two editable R objects.

show.facets

If TRUE, shows delta vs. time as faceted by BOX.
Default is FALSE.

show.run_separations

If TRUE, shows limits between subruns.
Default is TRUE.

observations_file

Name of the csv file containing observations (without csv extension).
Observation csv file should contain the following columns:

  1. GROUP: observation subset group label if relevant

  2. BOX_ID: BOX ID (e.g., A, OCEAN...) as defined in isobxr master file.

  3. delta.def definition of delta value, e.g., d18O

  4. obs.delta average observed delta numerical value

  5. obs.CI confidence interval of delta value

  6. obs.CI.def definition of confidence interval, e.g., 95

  7. obs.counts number of observations corresponding to average delta

  8. Time time of observation in scenario timeline, in display time units

Default is NULL.

observations_groups

vector of observations groups to include in plot,
from GROUP column in observation csv file.
Default is NULL.

Value

A set of plots showing the evolution of delta and sizes with time.