I am converting between two programs that use different logic structures. The original program uses conditional statements to define probabilities. For example, if Condition_A = (1 OR 2 OR 3) AND Condition_B = (X OR Y) THEN Probability = 0.5. The table looks like this:
Condition_A Condition_B Probability
1, 2, 3 X, Y 0.5
The new program requires a separate line for each combination, like this:
Condition_A Condition_B Probability
1 X 0.5
2 X 0.5
3 X 0.5
1 Y 0.5
2 Y 0.5
3 Y 0.5
I have the top table and need to convert it into the bottom table. I am looking to write an R script to automate the conversion for ~2,000 conditional statements. I am totally stumped so I don't have any code to show what I have tried. TIA