rp.block: Blocks use of the R console until a panel is closed

View source: R/timer.r

rp.blockR Documentation

Blocks use of the R console until a panel is closed

Description

This function prevents the R console from accepting further input waits until a panel is closed. The function has two uses. The first is to keep R active when an R script is run in batch mode. This prevents the R session from terminating until the panel has been closed. The second use is to block the user from further use of the command prompt. There may be circumstances in which it is helpful to do this.

Usage

rp.block(panel)

Arguments

panel

the panel whose closure will lead to termination of rp.block.

Details

rp.block should usually be the very last function executed in a script, to prevent termination until the panel has been closed.

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package (http://www.stats.gla.ac.uk/~adrian/rpanel/)

See Also

rp.control

Examples

## Not run: 
# This function will be called on pressing the button "Simulate".
boxp.sim <- function(panel) {
  boxplot(rnorm(50))
  panel
}
# Create an rpanel and add the button "Simulate" to it.
panel <- rp.control()
rp.button(panel, action = boxp.sim, title = "Simulate")
rp.block(panel)

## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.block in rpanel...