Shiny Concepts Without Runtime
Input State
Choose a Control
A Shiny app keeps user input values in a named input object.
Program
Play the script to choose a modeled input control and see the current value label.
input_state.R
input_index <-
controls <- c("slider", "select", "checkbox")
values <- c("10", "north", "TRUE")
control <- controls[input_index]
value <- values[input_index]
label <- paste(control, value, sep = ":")
cat(label, "\n", sep = "")
input_index <-
controls <- c("slider", "select", "checkbox")
values <- c("10", "north", "TRUE")
control <- controls[input_index]
value <- values[input_index]
label <- paste(control, value, sep = ":")
cat(label, "\n", sep = "")
input_index <-
controls <- c("slider", "select", "checkbox")
values <- c("10", "north", "TRUE")
control <- controls[input_index]
value <- values[input_index]
label <- paste(control, value, sep = ":")
cat(label, "\n", sep = "")
input state
A modeled input has a control name and a current value.
selection
Indexing vectors lets one small script represent several controls.
label
The label makes the selected input state visible without running Shiny.