| mc_match | R Documentation |
Matches two mcnodes by:
Group matching - Align nodes with same scenarios but different group order
Scenario matching - Align nodes with same groups but different scenarios
Null matching - Add missing groups across different scenarios
mc_match(mcmodule, mc_name_x, mc_name_y, keys_names = NULL)
mcmodule |
Monte Carlo module |
mc_name_x |
First node name |
mc_name_y |
Second node name |
keys_names |
Names of key columns |
List containing matched nodes and combined keys (keys_xy)
test_module <- list(
node_list = list(
node_x = list(
mcnode = mcstoc(runif,
min = mcdata(c(1, 2, 3), type = "0", nvariates = 3),
max = mcdata(c(2, 3, 4), type = "0", nvariates = 3),
nvariates = 3
),
data_name = "data_x",
keys = c("category")
),
node_y = list(
mcnode = mcstoc(runif,
min = mcdata(c(5, 6, 7), type = "0", nvariates = 3),
max = mcdata(c(6, 7, 8), type = "0", nvariates = 3),
nvariates = 3
),
data_name = "data_y",
keys = c("category")
)
),
data = list(
data_x = data.frame(
category = c("A", "B", "C"),
scenario_id = c("0", "0", "0")
),
data_y = data.frame(
category = c("B", "B", "B"),
scenario_id = c("0", "1", "2")
)
)
)
result <- mc_match(test_module, "node_x", "node_y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.