Description Usage Arguments Details Value Author(s) See Also Examples
Function that wraps the result of mapFuncToWidget
as an R\ function that pop us a widget representing the function.
1 2 | makeWidgetCmd(frmTitle,fun,baseFrame=.TkRoot,STORE=storageName(),
GRAB=TRUE,SINGLE.EVAL=FALSE)
|
frmTitle |
title of the GUI window. |
fun |
function to map. |
baseFrame |
|
STORE |
A string. Name of the place where to store details needed by the GUI to perform the execution. |
GRAB |
Logical. When |
SINGLE.EVAL |
Logical. When set to |
The main use of this function is to obtain a function that called
creates a widget that allows the parameter input and execution of
function fun
. It also adds a Quit fun
function
to close the widget.
This function returns an R\ function.
Jorge Luis Ojeda Cabrera (jojeda@unizar.es).
miniGUI
, mapFuncToWidget
,
tcltk
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | require(tcltk)
##
## a simple example
##
g <- function(a=1,b=rnorm) {cat("--g--");paste("g(a,b)=",a+b(a))}
h <- function(a=1,b=3,c=3) {cat("--h--");paste("h(a,b,c)=",a+b+c)}
## create functions
gg <- makeWidgetCmd("Hay it is g !!",g,GRAB=FALSE)
hh <- makeWidgetCmd("Hay h here !!",h,GRAB=FALSE)
## calling them
gg()
cat("\nClose it before calling hh(), they sharer parameters a and b!!")
hh()
##
## simple example(continuation)
##
## to be able to use both at the same time:save info for h in other place
hh <- makeWidgetCmd("Hay h here !!",h,STORE="h")
gg()
hh()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.