vary_param: Generate copies of a 'config' with a modified parameter

Description Usage Arguments Value Examples

View source: R/config.R

Description

Create copies of a config with a modified parameter. These new configs can be used to see how that parameter affects the model

Usage

1
2
3
4
5
6
7
8
9
vary_param(
  cfg,
  param_row = NA,
  to = NA,
  from = NA,
  param_name = NA,
  host_spp = NA,
  values
)

Arguments

cfg

Base config to make modified copies of

param_row

Row number of parameter to vary, if this is specified arguments from, to, param_name, and host_spp are unneeded

to

The to life stage of the parameter to change.

from

The from life stage from of the parameter to change. If this is given, to and param_name are also needed.

param_name

The name of the parameter to change

host_spp

The host_spp identifying the parameter to change. Needed only if there are multiple rows in the parameter table with the same from, to and param_name, but different host_spp.

values

Numeric vector of values to use for parameter

Value

A list of configs

Examples

1
2
3
4
5
6
7
# create new configs with different values for the parameter determining
# mortality of eggs (which is found in row 2)
cfgs <- vary_param(config_ex_1, param_row = 2, values = c(0, 0.1, 0.2))

# inspect parameter row 2 in each of the new configs to verify that we have
# the new values
lapply(cfgs, function(cfg) cfg$parameters[[2, 'param_value']])

IxPopDyMod documentation built on Feb. 8, 2022, 9:07 a.m.