input_variable: Add an internal variable to a website

View source: R/input_variable.R

input_variableR Documentation

Add an internal variable to a website

Description

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

## Not run: 
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"

## End(Not run)

uva-bi-sdad/community documentation built on Oct. 12, 2023, 1:18 p.m.