Package: mcmodule 1.3.1.9000

mcmodule: Modular Monte Carlo Risk Analysis

Framework for building modular Monte Carlo risk analysis models. It extends the capabilities of 'mc2d' to facilitate working with multiple risk pathways, variates and scenarios. It provides tools to organize risk analysis in independent flexible modules, align multivariate mcnodes, automate the creation of mcnodes, visualise model structure, assess convergence, and perform sensitivity analysis. For more details see Ciria (2026) <https://nataliaciria.com/mcmodule/>.

Authors:Natalia Ciria [aut, cre, cph], Alberto Allepuz [ths], Giovanna Ciaravino [ths]

mcmodule_1.3.1.9000.tar.gz
mcmodule_1.3.1.9000.zip(r-4.7-any)mcmodule_1.3.1.9000.zip(r-4.6-any)mcmodule_1.3.1.9000.zip(r-4.5-any)
mcmodule_1.3.1.9000.tgz(r-4.6-any)mcmodule_1.3.1.9000.tgz(r-4.5-any)
mcmodule_1.3.1.9000.tar.gz(r-4.7-any)mcmodule_1.3.1.9000.tar.gz(r-4.6-any)
mcmodule_1.3.1.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
mcmodule/json (API)

# Install 'mcmodule' in R:
install.packages('mcmodule', repos = c('https://nataliaciria.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/nataliaciria/mcmodule/issues

Pkgdown/docs site:https://nataliaciria.com

Datasets:

On CRAN:

Conda:

5.68 score 4 scripts 355 downloads 39 exports 78 dependencies

Last updated from:bca5650144. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK162
source / vignettesOK216
linux-releaseOK182
macos-releaseOK146
macos-oldrelOK144
windows-develOK146
windows-releaseOK142
windows-oldrelOK154
wasm-releaseOK122

Exports:add_prefixagg_totalsagg_variatesat_least_onecombine_modulescreate_mcnodeseval_moduleget_edge_tableget_node_tablematrix_to_mcnodesmc_comparemc_filtermc_keysmc_matchmc_match_datamc_networkmc_plotmc_summarymcmodule_convergmcmodule_corrmcmodule_infomcmodule_tornadomcnode_na_rmmcnode_null_rmmctable_boundsmctable_sobol_matricesoptim_ndvarreset_data_keysreset_mctablereset_sample_designset_data_keysset_mctableset_sample_designtidy_mcnodetrial_totalswhich_mcnodewhich_mcnode_infwhich_mcnode_nawif_match

Dependencies:abindbackportsbootbroomcarcarDataclicolorspacecorrplotcowplotcpp11DerivdoBydplyrfarverforecastFormulafracdiffgenericsggplot2ggpubrggrepelggsciggsignifgluegridExtragtableisobandlabelinglatticelifecyclelme4lmtestmagrittrMASSMatrixMatrixModelsmc2dmgcvminqamodelrmvtnormnlmenloptrnnetnumDerivpbkrtestpillarpkgconfigpolynompurrrquantregR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackreformulasrlangrstatixS7scalesSparseMstringistringrsurvivaltibbletidyrtidyselecttimeDateurcautf8vctrsviridisLitewithrzoo

mcmodule
Introduction | Multivariate Monte-Carlo simulations | Risk assessment | A simple risk assessment | Multiple risk assessments at once | When to use mcmodule? | Installing mcmodule | Building an mcmodule | Data | Data keys | mcnodes table | Expressions | Creating mcnodes within expressions | Evaluating an mcmodule | Understanding mcnodes operations | Working with an mcmodule | Visualizing | Summarizing | Filtering | Filtering a single condition | Filtering with multiple conditions | Calculating totals | Single-level trials | Multilevel trials | Simple multilevel | Aggregated totals | Working with what-if scenarios | Working with multiple mcmodules | Inputs from previous mcmodules | Combining mcmodules | Getting module information | Model analysis | Convergence analysis | Correlation analysis | Sensitivity analysis | Sobol indices analysis | Tricks and tweaks | Handling missing and infinite values in mcnodes | Customizing total node names | Prefixing mcmodules to avoid name duplication | Functions that work outside mcmodules | Convert to other formats | Next steps | References

Last update: 2026-10-08
Started: 2025-05-05

Sensitivity analysis
Scenario analysis | Correlation analysis | Sensitivity analysis with sample design | Create a sample design | Define sample space in mctable | Morris elementary effects | Sobol indices | Other methods | References

Last update: 2026-10-08
Started: 2026-05-22

Multivariate operations
Element-wise operations | Row matching | Group matching | Scenario matching | Null matching | Combined probabilities | Row aggregation | Probabilities | Quantities | Trials | Single-level trials | Multilevel trials | Simple multilevel | Multiple group multilevel trials

Last update: 2026-05-22
Started: 2025-09-25

Readme and manuals

Help Manual

Help pageTopics
Add Prefix to mcnode Namesadd_prefix
Aggregate mcnode Values Across Groups (Deprecated)agg_totals
Aggregate mcnode Values Across Groupsagg_variates
Animal Import Dataanimal_imports
Combine Probabilities Assuming Independenceat_least_one
Validate and Prepare mctable Data Framecheck_mctable
Combine Two mcmodule Objectscombine_modules
Create mcnodes from Data and Configuration Tablecreate_mcnodes
Evaluate Monte Carlo Model Expressionseval_module
Generate Edge Table for Network Visualisationget_edge_table
Get Nodes from Monte Carlo Moduleget_mcmodule_nodes
Create Node List from Model Expressionget_node_list
Generate Node Table for Network Visualisationget_node_table
Merged Animal Import Dataimports_data
Data Keys for the Animal Import Exampleimports_data_keys
Model Expression for the Animal Import Exampleimports_exp
Example Monte Carlo Module for Animal Importsimports_mcmodule
Monte Carlo Node Specifications for the Animal Import Exampleimports_mctable
Intrusion-Pathway Expression for the Water Supply Exampleintrusion_exp
Match and Align Keys Between Datasetskeys_match
Create mcnodes from Matrix/Data Framematrix_to_mcnodes
Compare Monte Carlo Node Against Baseline Scenariomc_compare
Filter mcnode Variates by Conditionmc_filter
Extract Key Columns from Monte Carlo Nodesmc_keys
Match Two Monte Carlo Nodesmc_match
Match Monte Carlo Node with Data Framemc_match_data
Create Interactive Network Visualisationmc_network
Plot Monte Carlo Node Distribution with Boxplot and Scatter Pointsmc_plot
Summarise Monte Carlo Node Valuesmc_summary
Analyse Monte Carlo Simulation Convergencemcmodule_converg
Calculate Correlation Coefficients Between Inputs and Outputsmcmodule_corr
Check Dimension Compatibility of Monte Carlo Nodesmcmodule_dim_check
Get Comprehensive Monte Carlo Module Informationmcmodule_info
Convert Monte Carlo Module to Matricesmcmodule_to_matrices
Convert Monte Carlo Module to 'mc2d' Objectsmcmodule_to_mc
Plot Tornado-Style Correlation Results Across Variatesmcmodule_tornado
Replace NA and Infinite Values in mcnode Objectsmcnode_na_rm
Replace NULL mcnode objectmcnode_null_rm
Extract Sample Space Bounds From mctablemctable_bounds
Sobol sampling matrices from an mctablemctable_sobol_matrices
Optimize Number of Variability Iterations Based on Convergenceoptim_ndvar
Regional Pathogen Prevalence Dataprevalence_region
Reset Data Keysreset_data_keys
Reset Monte Carlo Inputs Tablereset_mctable
Reset Global Sample Designreset_sample_design
Set or Get Global Data Keysset_data_keys
Set or Get Monte Carlo Inputs Tableset_mctable
Set or Get Global Sample Designset_sample_design
Diagnostic Test Sensitivity Datatest_sensitivity
Convert mcnode to Long Format for Plottingtidy_mcnode
Treatment-Pathway Expression for the Water Supply Exampletreatment_exp
Trial Probability and Expected Countstrial_totals
Generate Formatted visNetwork Edge TablevisNetwork_edges
Generate Formatted Network Node Table for VisualisationvisNetwork_nodes
Water Supply Example Datawater_data
Data Keys for the Water Supply Examplewater_data_keys
Water Supply Example Data by Consumption Groupwater_group_data
Data Keys for the Consumption-Group Water Examplewater_group_data_keys
Monte Carlo Node Specifications for the Water Supply Examplewater_mctable
Find mcnodes Matching a Conditionwhich_mcnode
Find mcnodes with Infinite Valueswhich_mcnode_inf
Find 'mcnode's with Missing Valueswhich_mcnode_na
Match Datasets with Differing Scenarioswif_match