control_switch {switchboard} | R Documentation |
The control_switch
widget displays a switch to toggle the state (e.g., on or
off, TRUE or FALSE) of a simulation variable. A switch is blue when "on",
and gray when "off".
inject |
String of the variable name to be modified/injected by the
switch widget. For example, |
label |
A small caption/label for the widget. |
size |
A number used to designate the size (magnification) of the
widget. The default is set to |
placeOnGrid |
A row by column coordinate (e.g., |
Nothing.
control_switch(inject = "", label = "", size = 1, placeOnGrid = c(1, 1))
Other injectors:
control_slider_Y_pair()
,
control_slider_Y()
,
control_slider_pair()
,
control_slider()
,
control_switch_pair()
,
control_switch_trio()
,
injector_2D()
,
injector_X()
,
injector()
## Not run:
varToSwitch <- 0
for (i in 1:500) {
switchboard(delay = 0.01) %>%
control_switch("varToSwitch", label = "0 to 1") %>%
number(varToSwitch)
}
switchboard_close()
## End(Not run)