injector_2D: Inject and eavesdrop two continuous variables on a bivariate...

Description Arguments Value Usage See Also Examples

View source: R/injector_2D.R

Description

The injector_2D widget displays a bivariate window of data with two sliderd that injects/modifies characteristics of the data. The plotted data have a half-life and are deleted once their timer (parameter forget) expires. For the univariate version use injector. The number of data points in the window can be throttled with forget or delay. Options also include automatic regression (plotRegression) and an the sample size of the number of data points currently displayed (plotSampleSize).

Arguments

eavesdrop

A vector of two variables to track on a bivariate plot. For example, eavesdrop = c(A, B) would result on A being plotted on X-axis (independent variable) and B on Y-axis (dependent variable).

minimum

A vector of the two minimum values of variables in eavesdrop. For example, eavesdrop = c(A, B) then minimum = c(C, D) are the minimum values of A and B, respectively. They define plot boundaries.

maximum

A vector of the two maximum values of variables in eavesdrop. For example, eavesdrop = c(A, B) then maximum = c(C, D) are the maximum values of A and B, respectively. They define plot boundaries.

inject

A vector of the two strings for each variable name to be modified/injected by widgets. For example, if eavesdrop = = c(A, B) then inject = c("A", "B").

label

A vector of the two short strings designating labels/captions for each of in eavesdrop.

size

A number used to designate the size (magnification) of the widget. The default is set to 1 which is 80 by 80 pixels. For example, setting to 3 will results in a widget 3-times the default size (240 by 240 pixels) and will occupy a grid area of 3 by 3.

placeOnGrid

A row by column coordinate (e.g., c(row-number, column-number)) of a grid that designates the position to draw the widget on the switchboard. Use showGrid() to help organize widget placement on dashboard. The default places the first widget in pipe chain to the c(1, 1) position, and all following on the same row stacked to the right.

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.

forget

A time-delay in milliseconds for when displayed points on a widget will be deleted.

delay

Pause each update of the switchboard. Default has no delay, values are in seconds (e.g., delay = 0.01 results in 0.01 second delay with each iteration).

plotRegression

Display a switchboard-estimated regression line on a widget.

plotSampleSize

Display the number items (N) displayed within a widget.

switch

Display an on/off switch on a widget that controls widget updates. When TRUE it will add the switch in the off-state on the switchboard. The user must activate the switch to start the widget. The simulation proceeds even if the switch in in the off-state.

Value

Nothing.

Usage

1
2
3
4
injector_2D(eavesdrop = c(NULL, NULL), minimum = c(1, 1),
   maximum = c(1, 1), inject = c("", "") label = c("", ""), size = 1,
   placeOnGrid = c(1, 1), updates = 100, forget = 400, delay = 0,
   plotRegression = FALSE, plotSampleSize = FALSE, switch = FALSE)

See Also

Other eavesdroppers: benchmark(), counter_tally(), counter(), eavesdropper_2D(), eavesdropper_X(), eavesdropper(), injector_X(), injector(), 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_X(), injector()

Other moving windows: eavesdropper_2D(), eavesdropper_X(), eavesdropper(), injector_X(), injector()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
     
     populationMean = 0
     populationSD = 1
     for (i in 1:4000) {
       randomNormal <- rnorm(1, populationMean, populationSD)
       switchboard(delay = 0.01) %>%
         injector_2D(c(populationSD, randomNormal),
                     inject = c("populationSD", "populationMean"),
                     minimum = c(0.1, - 5),
                     maximum = c(3.1, 5),
                     label = c("pop mean", "pop SD"),
                     forget = 2000)
     }
     switchboard_close()


## End(Not run)

switchboard documentation built on Oct. 9, 2021, 1:06 a.m.