vary_many_params: Generate copies of a 'config' with all combinations of...

Description Usage Arguments Value Examples

View source: R/config.R

Description

Generate copies of a config with all combinations of modified parameters

Usage

1
vary_many_params(cfg, param_rows, values_list)

Arguments

cfg

Base config to make modified copies of

param_rows

Numeric vector indicating the rows in the parameters table where parameter values should be modified. Length must equal length of values_list

values_list

List of numeric vectors. The values of a vector values_list[[i]] are the parameter values to use for the parameter identified by param_rows[[i]]

Value

A list of configs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create new configs with different values for the parameter determining
# mortality of eggs (which is found in row 2) and that determining
# mortality of larvae (which is found in row 4)
cfgs <- vary_many_params(config_ex_1,
                        param_rows = c(2, 4),
                        values_list = list(c(0, 0.1), c(.99, .98)))

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

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