eavesdropper_X: Eavesdrop a continuous variable as a conveyor belt.

Description Arguments Value Usage See Also Examples

View source: R/eavesdropper_X.R

Description

The eavesdropper_X widget displays a vertical moving window of data (see eavesdropper for a horizontal window). The Y-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 eavesdropper_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 eavesdrop. It defines the plot boundary

maximum

The maximum value of eavesdrop. It defines the plot boundary

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 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.

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).

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 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
eavesdropper_X(eavesdrop, minimum = 1, maximum = 100,
   label = "", size = 1, placeOnGrid = c(1, 1), updates = 100, delay = 0,
   plotMean = FALSE, switch = FALSE)

See Also

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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
     
     for (i in 1:400) {
       randomNormal <- rnorm(1, 0, 1)
       switchboard(delay = 0.01) %>%
         eavesdropper_X(randomNormal, minimum = -5, maximum = 5)
     }
     switchboard_close()


## End(Not run)

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