control_switch_pair {switchboard} | R Documentation |
A pair of switches to toggle on/off two simulation variables.
Description
The control_switch_pair
widget displays two switches to toggle the state
(e.g., on or off, TRUE
or FALSE
) of two simulation variables.
A switch is blue when "on", and gray when "off".
Arguments
inject |
A vector of the two strings for each variable name to be
modified/injected by the switch widget. For example, |
label |
A vector of two short strings designating labels/captions for each switch. |
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., |
Value
Nothing.
Usage
control_switch_pair(inject = c("", ""), label = c("", ""), size = 1, placeOnGrid = c(1, 1))
See Also
Other injectors:
control_slider_Y_pair()
,
control_slider_Y()
,
control_slider_pair()
,
control_slider()
,
control_switch_trio()
,
control_switch()
,
injector_2D()
,
injector_X()
,
injector()
Examples
## Not run:
varToSlideA <- 0
varToSlideB <- 0
for (i in 1:500) {
switchboard(delay = 0.01) %>%
control_switch_pair(inject = c("varToSlideA", "varToSlideB"),
label = c("0 to 1", "0 to 1")) %>%
number_pair(c(varToSlideA, varToSlideB))
}
switchboard_close()
## End(Not run)