rpanel (version 1.1-4)

rp.block: 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.

Value

Nothing is returned.

Details

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

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

Run this code
# 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)
# }

Run the code above in your browser using DataLab