varEntryDialog: This function will create a tcl/tk dialog box to get user...

View source: R/varEntryDialog.R

varEntryDialogR Documentation

This function will create a tcl/tk dialog box to get user input. It has been written to be extensible so the R programmer can easily create a dialog with any number of varaibles with custom labels and data conversion of the user entered data. The function will return a list where the element names are vars and the value is the user input. By default, all entry will be converted using the as.character function. However, this can easily be altered using the fun parameter. For example, if integers are required, use fun=c(as.integer, ...). It is also possible to write custom functions that can serve as a data validation. See the examples.

Description

Adopted from Kay Cichini: http://thebiobucket.blogspot.com/2012/08/tcltk-gui-example-with-variable-input.html See also: http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/OKCancelDialog.html

Usage

varEntryDialog(
  vars,
  labels = vars,
  fun = rep(list(as.character), length(vars)),
  title = "Variable Entry",
  prompt = NULL
)

Arguments

vars

character list of variable names. These will be the element names within the returned list.

labels

the labels the user will see for each variable entry.

fun

list of functions that converts the user input.

title

the title of the dialog box.

prompt

the prompt the user will see on the dialog box.

Value

a list of named values entered by the user.


belasi01/Cops documentation built on Feb. 26, 2024, 6:52 a.m.