Skip to contents

Creates an internal variable (virtual input), which can be used for display logic.

Usage

input_variable(id, cases, default = "", display = list())

Arguments

id

Name of the variable, which can be referred to by other inputs of outputs.

cases

A list of conditions with names specifying conditions, and values to set the variable to in that condition (e.g., list("input_a == 1" = 1)). These can also be specified separately with an input_rule.

default

The value to set if no condition is TRUE.

display

A list mapping cases names to display names (e.g., list(value = "Value")).

Value

A version of the resulting variable object.

Examples

if (FALSE) {
input_select("input_a", c("a", "b", "c"))
input_variable("vinput_a", list("input_a == c" = "b"), "a")

# vinput_a will be "a" unless input_a is "c"
}