Learn R Programming

mcmodule (version 1.2.0)

set_mctable: Set or Get Monte Carlo Inputs Table

Description

Manages the global mctable (Monte Carlo nodes reference table) by setting or retrieving its value. The table stores metadata about mcnodes including descriptions, functions, and sensitivity analysis parameters.

Usage

set_mctable(data = NULL)

Value

Current or newly set mctable. Columns include: mcnode (required), description, mc_func, from_variable, transformation, sensi_baseline, sensi_variation.

Arguments

data

(data frame, optional). mctable with at minimum an mcnode column. Other columns auto-filled if absent. If NULL, returns the current table. Default: NULL.

Examples

Run this code
# Get current MC table
current_table <- set_mctable()

# Set new MC table
mct <- data.frame(
  mcnode = c("h_prev", "w_prev"),
  description = c("Herd prevalence", "Within herd prevalence"),
  mc_func = c("runif", "runif")
)
set_mctable(mct)

Run the code above in your browser using DataLab