eavesdropper_2D {switchboard}R Documentation

Eavesdrop two continuous variables on a bivariate plot.

Description

The eavesdropper_2D widget displays a bivariate window of data. The plotted data have a half-life and are deleted once their timer (parameter forget) expires. For the univariate version use eavesdropper. 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.

label

A vector of two short strings designating labels/captions for each variable used 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

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

See Also

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

Other eavesdroppers: benchmark(), counter_tally(), counter(), eavesdropper_X(), eavesdropper(), injector_2D(), injector_X(), injector(), number_pair(), number_quartet(), number_trio(), number(), progress_benchmark()

Examples

## Not run: 
     
     for (i in 1:10000) {
       x <- cos(i/400) 
       y <- sin(2 * i/400) / 2 
       switchboard(skip = 4) %>%
         eavesdropper_2D(c(x, y), minimum = c(-1, -1), maximum = c(1, 1), forget = 100)
     }
     switchboard_close()


## End(Not run)


[Package switchboard version 0.1 Index]