createWF {widgetInvoke} | R Documentation |
This function will present a widget (currently using Gtk) that will
allow the user (in this case, typically a package author or
maintainer) to specify the structure of the function widgets used by
widgetInvoke
.
createWF(funName)
funName |
The name of the function to create a widget for |
The package that funName
is in must already be loaded via
library
for this function to work properly.
This function will use RGtk to display a widget detailing the
arguments of the specified function, and other information to be used
for the widgetInvoke
function. The widget presents a
six column table, with the first column detailing each argument name.
The arguments themselves are represented by the rows of the table.
The Type
column specifies the type of the argument
(e.g. character
, logical
, etc). If this field is blank,
it is assumed that any type of value may be entered in by the
widgetInvoke
user. A character vector can be entered
to specify a set of possible values (e.g. "mean", "median"
)
that the argument is allowed to take - to do this use comma separated,
quoted strings.
The Default
column is used to specify the default value of the
argument, if any. Leaving this field blank will imply that there is
no default value, otherwise the value in this field must be of the
type specified by type
.
The Location
column describes where this argument will appear.
The widget used by widgetInvoke
allows for notebook
style paning, and this field will specify which pane the argument will
appear on. By default, all arguments appear on the "main" pane, but
by specifying another string a new pane will be created.
WidgetType
allows the user to specify what sort of widget is
used by widgetInvoke
for the entry of this argument.
Currently, logical and vector types must use either Radio
or
DropDown
and all other types must use TypeIn
.
If the Required
check box is marked for an argument, that means
that the argument must be filled in with a value by the
widgetInvoke
user.
The Reset
button can be used to bring the entire table back to
its original state. Any changes the user has made will be reverted.
The Check
button will check the validity of all the values
stored in the table and report to the user if there are potential
problems.
The Preview
button will display a window that will be identical
to what the widgetInvoke
user will see. For this
sub-window, the Evaluate
window will not actually evaluate the
function, but simply close the window.
The Save
button will save the information in the table to an
XML file in the current directory, of the name FUN.xml
, where
FUN
is the name of the function.
This function is used for its side effect, which is to output a file
with the appropriate meta-data. The default filename is
funName.xml
(where funName
is the same as the value
specified by the parameter) and stored in the current working
directory of the R session. By using the Save As
button,
this can be changed, and saved to any file the operator wishes.
Jeff Gentry
if (interactive()) createWF("testWIfun")