Learn R Programming

mcmodule (version 1.2.0)

mcmodule_info: Get Comprehensive Monte Carlo Module Information

Description

Extracts comprehensive metadata about a Monte Carlo module, including:

  • Module composition (raw vs combined modules)

  • Input data per expression

  • Keys for each variate (data row)

  • Global data keys

Usage

mcmodule_info(mcmodule)

Value

A list with six elements:

is_combined

Logical. TRUE if module is combined, FALSE if raw

n_modules

Integer. Number of component modules (1 for raw, >1 for combined)

module_names

Character vector. Names of all component modules (recursive)

module_exp_data

Data frame with module and expression information, including data_name

data_keys

Data frame with keys for each variate, including variate number and data_name

global_keys

Character vector of global key names used across the module

Arguments

mcmodule

A Monte Carlo module object

Details

A raw module has a single expression in mcmodule$exp. A combined module has multiple expressions in mcmodule$exp, each representing a component module that was combined via combine_modules().

For combined modules, module names are recursively extracted up to one level deep. This allows identifying all base modules even in deeply nested combinations.

Examples

Run this code
# Get comprehensive module information
info <- mcmodule_info(imports_mcmodule)
str(info)

# Access composition information
info$is_combined
info$n_modules
info$module_names

# Access index information
head(info$module_exp_data)
head(info$data_keys)
info$global_keys

Run the code above in your browser using DataLab