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)

Arguments

x

option 1

y

option 2

reject

if TRUE, the condition rejects universes with option 1 and option 2

Value

A branch_condition object.

See also

Other branch condition functions: add_branch_condition()

Examples

# 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)