rp.control | R Documentation |
The function rp.control
creates a panel window into which rpanel widgets can be placed. It can also set up variables within the rpanel object. The function rp.control.dispose
disposes of an rpanel.
rp.control(title = "", size = c(100, 100), panelname, background, ...) rp.control.dispose(panel)
title |
the title of the panel displayed in the banner. |
size |
a two-element numeric vector specifying width and height of the panel in pixels. If this argument is omitted the size of the panel will adapt to the subsequent addition of widgets. |
panelname |
the name of the panel. It is usually not necessary to set this as it will be given a name automatically. |
background |
the background colour of the control e.g. "white". (New parameter with version 2.0.) |
... |
additional arguments which are treated as variable initialisations and are stored within the returned rpanel object. For example inserting |
panel |
the panel to be disposed of. This represents the object and its parameters |
Objects passed into rp.control
are then available to be used by action functions.
The list object which defines the panel.
Previous arguments realname
and aschar
have been discontinued in version 1.1.
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
rp.button
,
rp.checkbox
,
rp.combo
,
rp.doublebutton
,
rp.grid
,
rp.image
,
rp.listbox
,
rp.menu
,
rp.radiogroup
,
rp.slider
,
rp.text
,
rp.textentry
,
rp.tkrplot
,
rp.widget.dispose
## Not run: hist.or.boxp <- function(panel) { if (panel$plot.type == "histogram") hist(panel$x) else boxplot(panel$x) panel } panel <- rp.control(x=rnorm(50), panelname="panel") rp.radiogroup(panel, plot.type, c("histogram", "boxplot"), title="Plot type", action = hist.or.boxp) # Try also # panel <- rp.control() # rp.control.dispose(panel) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.