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)A branch_condition object.
Other branch condition functions:
add_branch_condition()
# Example branches.
y <- mutate_branch(alldeaths, log(alldeaths + 1))
model <- formula_branch(y ~ MasFem * strength, y ~ MasFem + 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)