| rp.panelname {rpanel} | R Documentation |
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.
rp.panelname(new = TRUE)
new |
optional parameter. When set to FALSE this will return the most recently created panel name. |
A string of the form 'rpanelx', where x is an integer.
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.
rpanel: Simple interactive controls for R functions using the tcltk package (http://www.stats.gla.ac.uk/~adrian/rpanel/)
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()