gui.menu {utilitiesR}R Documentation

cross-platform item selection interface

Description

This is a cross-platform function to allow the user to choose an item from a list of items interactively. If graphics=TRUE, select.list is used on Windows (similar to the "Select CRAN repository..." when you install.packages), and tcltk::tk_select.list otherwise (& if supported), and an interactive text interface (menu(...,graphics=F)) if all else fails.

Usage

  gui.menu(choices, title = NULL, multi = FALSE,
    index.return = FALSE, graphics = TRUE)

Arguments

choices

vector of choices to select from

index.return

whether to return the selected item from choices, or the index of the selected item in choices

title

title for dialog

multi

whether to allow selection of multiple items

graphics

whether to present a graphics interface (if possible)

Value

the item(s) chosen (vector), either indices or values, depending on index.return. If is.empty is TRUE, the user selected 'Cancel'.

See Also

Other ui: dir.browse, file.browse, Filters, gui.dir.choose, gui.file.choose, gui.readline, gui.yesno, tk_entry.dialog, tk_select.list


[Package utilitiesR version 1.8.2 Index]