The **switchboard** package for R
is an agile widget engine for creating dynamic, real-time dashboards
for iterative simulations (e.g., for/while loops). It contains a
growing, unsorted collection of visualization widgets rendered in a
Tcl/Tk GUIâ€“these include progress bars, counters, eavesdroppers,
injectors, switches, and sliders. Below is a brief tutorial to get
started on creating your own dashboards.

Updates to this vignette will be posted on our research webpage at USF.

For the source code of **switchboard** see: http://cran.r-project.org/web/packages/juicr/index.html or https://github.com/mjlajeunesse/switchboard.

Lajeunesse, M.J. (2021) Creating dynamic, real-time dashboards with the **switchboard** package for *R*. R package, v. 0.1.

Please email me any bugs, comments, or suggestions and Iâ€™ll try to include them in future releases: lajeunesse@usf.edu. Also try to include **switchboard**
in the subject heading of your email. Finally, Iâ€™m open to almost
anything, but expect a lag before I respond and/or new additions are
added.

Here is how you would script a small Monte Carlo simulation exploring the effects of sample size on linear regression estimation:

```
library(switchboard)
library(MASS)
pop_rho <- 0
pop_X <- 0
pop_Y <- 0
pop_forget <- 400 #milliseconds
ctrl_regression <- FALSE
ctrl_N <- FALSE
for(i in 1:1e5) {
cov_XY <- matrix(c(1, pop_rho, pop_rho, 1), nrow = 2, ncol = 2)
sample_XY <- MASS::mvrnorm(1, mu = c(pop_X, pop_Y), Sigma = cov_XY)
switchboard() %>%
caption(c("Monte Carlo Simulation",
"Slide sample size to see how it impacts regression estimation.
Few samples results in poor estimation."),
placeOnGrid = c(1,1), size = 2) %>%
control_switch_pair(c("ctrl_regression", "ctrl_N"),
label = c("regression line", "plot N"), placeOnGrid = c(1,3)) %>%
control_slider_pair(c("pop_r
```