module <- list(
node_list = list(
p1 = list(
mcnode = mcstoc(runif,
min = mcdata(c(0.1, 0.2, 0.3), type = "0", nvariates = 3),
max = mcdata(c(0.2, 0.3, 0.4), type = "0", nvariates = 3),
nvariates = 3
),
data_name = "data_x",
keys = c("category")
),
p2 = list(
mcnode = mcstoc(runif,
min = mcdata(c(0.5, 0.6, 0.7), type = "0", nvariates = 3),
max = mcdata(c(0.6, 0.7, 0.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")
)
)
)
module <- at_least_one(module, c("p1", "p2"), name = "p_combined")
print(module$node_list$p_combined$summary)
Run the code above in your browser using DataLab