A branch condition conditions option x
to
depend on option y
. When the branch condition
is added to a mverse
object, option x
is executed only when y
is. Use reject = TRUE
,
to negate the condition.
branch_condition(x, y, reject = FALSE)
option 1
option 2
if TRUE, the condition rejects universes with option 1 and option 2
A branch_condition
object.
Other branch condition functions:
add_branch_condition()
# Example branches.
y <- mutate_branch(alldeaths, log(alldeaths + 1))
model <- formula_branch(y ~ femininity * strength, y ~ femininity + strength)
# Define a new branch condition.
match_poisson <- branch_condition(alldeaths, poisson)
# Define a branch condition that reject an option dependent on another.
match_log_lin <- branch_condition(log(alldeaths + 1), poisson, reject = TRUE)