e2e_compare_runs_box: Box and whisker plots comparing annual or monthly outputs...

Description Usage Arguments Details Value See Also Examples

View source: R/e2e_compare_runs_box.R

Description

Generate a multi-panel set of box and whisker diagrams comparing annual or monthly averaged or integrated model outputs from single or Monte Carlo baseline (black) and scenario (red) model runs. Each panel of annual data displays a different category of model data; each panel of monthly data shows a different nutrient or plankton guild.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
e2e_compare_runs_box(
  selection = "ANNUAL",
  model1,
  ci.data1 = FALSE,
  use.saved1 = FALSE,
  use.example1 = FALSE,
  results1 = NULL,
  model2,
  ci.data2 = FALSE,
  use.saved2 = FALSE,
  use.example2 = FALSE,
  results2 = NULL
)

Arguments

selection

Text string from a list to select comparison with annual or monthly observations. Select from: "ANNUAL", "MONTHLY". Remember to include the phrase within "" quotes.

model1

R-list object defining the baseline model configuration compiled by the e2e_read() function.

ci.data1

Logical. If TRUE plot credible intervals around baseline model results based on Monte Carlo simulation with the e2e_run_mc() function (default=FALSE).

use.saved1

Logical. If TRUE use baseline data from a prior user-defined run held as csv files data in the current results folder (default=FALSE).

use.example1

Logical. If TRUE use pre-computed example data from the internal North Sea model as the baseline rather than user-generated data (default=FALSE).

results1

R-list object of baseline model output generated by the e2e_run() function. Only needed if ci.data1=FALSE, use.saved1=FALSE and use.example1=FALSE. (Default=NULL).

model2

R-list object defining the scenario model configuration compiled by the e2e_read() function.

ci.data2

Logical. If TRUE plot credible intervals around scenario model results based on Monte Carlo simulation with the e2e_run_mc() function (default=FALSE).

use.saved2

Logical. If TRUE use scenario data from a prior user-defined run held as csv files data in the current results folder (default=FALSE).

use.example2

Logical. If TRUE use pre-computed example data from the internal North Sea model as the scenario rather than user-generated data (default=FALSE).

results2

R-list object of baseline model output generated by the e2e_run() function. Only needed if ci.data2=FALSE, use.saved2=FALSE and use.example2=FALSE. (Default=NULL).

Details

Arguments determine the source of model data for comparison. These can be outputs from a Monte Carlo simulations (using the function e2e_run_mc()) to estimate credible intervals of model outputs, or from single model runs using e2e_run(). Generation of credible interval data is a long computing task, so example data for the North Sea model provided with the package are available as an illustration.

In each plot panel, where credible intervals of model outputs (from Monte Carlo analysis) have been selected the box spans 50 always shown in black, scenario results in red.

Value

Graphical display in a new graphics window.

See Also

e2e_read, e2e_run, e2e_run_mc, e2e_compare_runs_bar, e2e_compare_obs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Load the 1970-1999 version of the internal North Sea model and run for 1 year
    m1 <- e2e_read("North_Sea", "1970-1999")
    r1 <-e2e_run(m1,nyears=1)

# Load the 2003-2013 version of the internal North Sea model and run for 1 year
    m2 <- e2e_read("North_Sea", "2003-2013")
    r2 <-e2e_run(m2,nyears=1)

# Compare annual results from 1970-1999 as baseline with 2003-2013 as scenario:
    e2e_compare_runs_box(selection="ANNUAL", model1=m1, ci.data1=FALSE, results1=r1,
                                             model2=m2, ci.data2=FALSE, results2=r2)
# Compare monthly results from 1970-1999 as baseline with 2003-2013 as scenario:
    dev.new()
    e2e_compare_runs_box(selection="MONTHLY", model1=m1, ci.data1=FALSE, results1=r1,
                                          model2=m2, ci.data2=FALSE, results2=r2)

# This example requires the StrathE2E2examples supplementrary data package.
# Compare 1970-1999 as baseline (from single model run), with 2003-2013
# as scenario (from example data with credible interval results):
if(require(StrathE2E2examples)){
    e2e_compare_runs_box(selection="ANNUAL", model1=m1, ci.data1=FALSE, results1=r1,
                                             model2=m2, ci.data2=TRUE, use.example2=TRUE)
    dev.new()
    e2e_compare_runs_box(selection="MONTHLY", model1=m1, ci.data1=FALSE, results1=r1,
                                             model2=m2, ci.data2=TRUE, use.example2=TRUE)
}

# This example requires the StrathE2E2examples supplementrary data package.
# Compare 1970-1999 as baseline (from example data with cred.int.), with 2003-2013
# as scenario (from example data with credible interval results):
if(require(StrathE2E2examples)){
    e2e_compare_runs_box(selection="ANNUAL", model1=m1, ci.data1=TRUE, use.example1=TRUE,
                                             model2=m2, ci.data2=TRUE, use.example2=TRUE)
    dev.new()
    e2e_compare_runs_box(selection="MONTHLY", model1=m1, ci.data1=TRUE, use.example1=TRUE,
                                              model2=m2, ci.data2=TRUE, use.example2=TRUE)
}

StrathE2E2 documentation built on Jan. 23, 2021, 1:07 a.m.