add_item2: Define parameters that may be used in model calculations...

View source: R/input_f.R

add_item2R Documentation

Define parameters that may be used in model calculations (uses expressions)

Description

Define parameters that may be used in model calculations (uses expressions)

Usage

add_item2(.data = NULL, input)

Arguments

.data

Existing data

input

Items to define for the simulation as an expression (i.e., using )

Details

The functions to add/modify events/inputs use lists. If chaining together add_item2, it will just append the expressions together in the order established.

If using pick_val_v, note it should be used with the deploy_env = TRUE argument so that add_item2 process it correctly.

Value

A substituted expression to be evaluated by engine

Examples

library(magrittr)

add_item2(input = {fl.idfs <-  0})
add_item2(input = {
 util_idfs <- if(psa_bool){rnorm(1,0.8,0.2)} else{0.8}
 util.mbc <- 0.6
 cost_idfs <- 2500})
common_inputs <- add_item2(input = {
pick_val_v(
  base      = l_statics[["base"]],
  psa       = pick_psa(
    l_statics[["function"]],
    l_statics[["n"]],
    l_statics[["a"]],
    l_statics[["b"]]
  ),
  sens      = l_statics[[sens_name_used]],
  psa_ind   = psa_bool,
  sens_ind  = sensitivity_bool,
  indicator = indicators_statics,
  names_out = l_statics[["parameter_name"]],
  deploy_env = TRUE #Note this option must be active if using it at add_item2
)
}
)


WARDEN documentation built on June 11, 2025, 5:08 p.m.