| sf_branch | R Documentation |
Creates a single-condition branching rule that shows or hides a survey item depending on the value of a preceding item. Only single-condition rules are supported. Multi-condition AND/OR logic is planned for a later release.
sf_branch(
item_id,
depends_on,
operator = c("==", "!=", "%in%", ">", ">=", "<", "<="),
value,
action = c("show", "hide")
)
item_id |
Character. The |
depends_on |
Character. The |
operator |
Character. The comparison operator. One of |
value |
The value to compare against the response to |
action |
Character. What to do when the condition is met. Either
|
An object of class sf_branch (a named list).
sf_instrument(), validate_sframe()
# Show an open-text follow-up only when the respondent selects "Other"
rule <- sf_branch(
item_id = "gender_other",
depends_on = "gender",
operator = "==",
value = "other",
action = "show"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.