rp.tkrplot {rpanel} | R Documentation |
These functions call Luke Tierney's tkrplot
and tkrreplot
functions to allow R graphics to be displayed in a panel.
rp.tkrplot(panel, name, plotfun, action = I, parent = window, pos = NULL) rp.tkrreplot(panel, name)
panel |
the panel in which the plot should appear. This may be passed as a panelname string or the panel object itself. |
name |
the name of the plot. This is subsequently used in tkrreplot to specify the plot to be redrawn. |
plotfun |
the function used to create the plot. |
action |
the function called when the plot is clicked. |
parent |
this specifies the widget inside which the plot should appear. In the current version of rpanel, it should not normally be used. |
pos |
the layout instructions. Please see the rp.pos example and help for full details. |
The function action
should take one argument, which should be the panel to which the tkrplot is attached.
If the parameter panel is the panelname string the same string is returned. If the panel object is used the altered panel is assigned to both the calling level and panel's environment level.
The action
function should return the panel.
Without this assignment any widgets added or alterations made to panel parameters within
the action
function will be lost.
rpanel: Simple interactive controls for R functions using the tcltk library (http://www.stats.gla.ac.uk/~adrian/rpanel/)
rpplot <- rp.control(title = "Demonstration of rp.tkrplot", h = 1) redraw <- function(panel) { rp.tkrreplot(panel, tkrp) } rp.tkrplot(rpplot, tkrp, function(panel) plot(1:20, (1:20)^panel$h)) rp.slider(rpplot, h, action = redraw, from = 0.05, to = 2.00, resolution = 0.05)