add_branch_condition | R Documentation |
mverse
object.This method adds one or more branch conditions to
an existing mverse
object. Branch conditions
are used to specify an option in one branch dependent
on an option in another branch.
add_branch_condition(.mverse, ...)
## S3 method for class 'mverse'
add_branch_condition(.mverse, ...)
.mverse |
a |
... |
branch conditions. |
a mverse
object.
Other branch condition functions:
branch_condition()
# Define branches and add them to an \code{mverse} object.
y <- mutate_branch(alldeaths, log(alldeaths + 1))
distribution <- family_branch(poisson, gaussian)
# You can match branching options by providing the options
# the way provide them when defining branches.
match_poisson <- branch_condition(alldeaths, poisson)
mv <- mverse(hurricane) %>%
add_mutate_branch(y) %>%
add_family_branch(distribution) %>%
add_branch_condition(match_poisson)
summary(mv)
# You can also condition to reject a pair of options by
# setting reject = TRUE.
match_log_lin <- branch_condition(log(alldeaths + 1), poisson, reject = TRUE)
mv <- add_branch_condition(mv, match_log_lin)
summary(mv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.