injector {switchboard} | R Documentation |
Inject and eavesdrop a continuous variable.
Description
The injector
widget displays a horizontal moving window of data with
a slider that injects/modifies characteristics of the data. (see
injector_X
for a vertical version). The X-axis is time-lagged
and the widget keeps track of each point until it reaches the end of the
plot. This widget is univariate and only eavesdrops one variable; for a
bivariate version use injector_2D
. The number of data points in the
window can be throttled with delay
.
Arguments
eavesdrop |
The variable to track. |
minimum |
The minimum value of |
maximum |
The maximum value of |
inject |
String of the variable name to be modified/injected by widgets.
For example, if |
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., |
updates |
The number of times the widget is to be updated (e.g., when it be modified/changed). The default updates the widget 100 times. Increase number for smoother progress bar animation. |
delay |
Pause each update of the switchboard. Default has no delay,
values are in seconds (e.g., |
plotMean |
Display a small switchboard-estimated mean and standard deviation whisker plot on a widget. |
switch |
Display an on/off switch on a widget that controls widget updates.
When |
Value
Nothing.
Usage
injector(eavesdrop, minimum = 1, maximum = 100, inject = "", label = "", size = 1, placeOnGrid = c(1, 1), updates = 100, delay = 0, plotMean = FALSE, switch = FALSE)
See Also
Other eavesdroppers:
benchmark()
,
counter_tally()
,
counter()
,
eavesdropper_2D()
,
eavesdropper_X()
,
eavesdropper()
,
injector_2D()
,
injector_X()
,
number_pair()
,
number_quartet()
,
number_trio()
,
number()
,
progress_benchmark()
Other injectors:
control_slider_Y_pair()
,
control_slider_Y()
,
control_slider_pair()
,
control_slider()
,
control_switch_pair()
,
control_switch_trio()
,
control_switch()
,
injector_2D()
,
injector_X()
Other moving windows:
eavesdropper_2D()
,
eavesdropper_X()
,
eavesdropper()
,
injector_2D()
,
injector_X()
Examples
## Not run:
populationMean = 0
for (i in 1:4000) {
randomNormal <- rnorm(1, populationMean, 1)
switchboard(delay = 0.01) %>%
injector(randomNormal, inject = "populationMean", minimum = -5, maximum = 5)
}
switchboard_close()
## End(Not run)