rp.panelname {rpanel}R Documentation

Automatic generation of a panel name

Description

This creates the automatically assigned internal 'realname' parameter of a panel. 'realname' is the internally used name of the panel used by callback functions. In rpanel these will always have the form '.rpanelxxxxxxxx' where 'xxxxxxxx' is generated randomly whenever a panel is created.

Usage

rp.panelname(new = TRUE)

Arguments

new

optional parameter. When set to FALSE this will return the most recently created panel name.

Value

A string of the form 'rpanelx', where x is an integer.

Warning

Note: returning of the most recent panel may fail when running R on a Windows machine in DOS. A warning is contained within the function.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

See Also

rp.control

Examples

if (interactive()) {
   hist.draw <- function(panel) {
     hist(rnorm(50))
     panel
     }
   hist.sample <- function() {
     panel.name <- rp.panelname()
     rp.control(realname = panel.name)
     rp.button(panel.name, title = "Sample", action = hist.draw)
     }
   hist.sample()    
   }

[Package rpanel version 1.0-6 Index]