Learn R Programming

mcmodule (version 1.2.0)

mc_match_data: Match Monte Carlo Node with Data Frame

Description

Matches an mcnode with a data frame by aligning groups, scenarios, or adding missing groups across different scenarios.

Usage

mc_match_data(mcmodule, mc_name, data, keys_names = NULL)

Value

A list containing matched mcnode, matched data, and combined keys (keys_xy).

Arguments

mcmodule

(mcmodule object). Module containing node.

mc_name

(character). Node name.

data

(data frame). Data to match with mcnode.

keys_names

(character vector, optional). Column names for matching. Default: NULL.

Details

Matching proceeds in order:

  1. Group matching — same scenarios but different group order

  2. Scenario matching — same groups but different scenarios

  3. Null matching — add missing groups across different scenarios

Examples

Run this code
test_data  <- data.frame(pathogen=c("a","b"),
                         inf_dc_min=c(0.05,0.3),
                         inf_dc_max=c(0.08,0.4))
result<-mc_match_data(imports_mcmodule,"no_detect_a", test_data)

Run the code above in your browser using DataLab