Skip to contents

Get a selection of variables from a simulation result

Usage

get_result(
  cfg,
  scenario,
  variant = 0,
  filters = c(""),
  fun_format = NULL,
  m = read_bin_result_matrix(cfg, scenario, variant)
)

Arguments

cfg

a config object. Configuration to use. See loadConfig for details

scenario

numeric, the scenario to use

variant

numeric, the variant to use (0 by default means no variant)

filters

character conditions to select columns in result table, see details

fun_format

function to format the result (See tidy_result)

m

matrix of results produced by read_bin_result_matrix

Value

If format =NULL, it's a matrix of results with a first column "t" with the simulation time in seconds followed by columns selected by filters. Column names are a concatenation of nested SIC model elements separated by the character "|" and numbered after the character ":". The variable is represented by the item "var". For example, water elevation in the first section of the first reach is: "bf:1|sn:1|var:Z". If format = tidy_result or format = compact_tidy_result, see the documentation of tidy_result.

Examples

if (FALSE) {
cfg <- cfg_tmp_project()
sic_run_steady(cfg, scenario = 1)
get_result(cfg, 1, filters = c("bf==4", "var=='Z'"))
}