Rev 58549 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/utils/man/select.list.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2009 R Core Team% Distributed under GPL 2 or later\name{select.list}\alias{select.list}\title{Select Items from a List}\description{Select item(s) from a character vector.}\usage{select.list(choices, preselect = NULL, multiple = FALSE, title = NULL,graphics = getOption("menu.graphics"))}\arguments{\item{choices}{a character vector of items.}\item{preselect}{a character vector, or \code{NULL}. If non-null andif the string(s) appear in the list, the item(s) are selectedinitially.}\item{multiple}{logical: can more than one item be selected?}\item{title}{optional character string for window title, or\code{NULL} for no title.}\item{graphics}{logical: should a graphical widget be used?}}\details{The normal default is \code{graphics = TRUE}.#ifdef windowsThis brings up a modal dialog box with a (scrollable) listof items, which can be selected by the mouse. If \code{multiple} istrue, further items can be selected or deselected by holding thecontrol key down whilst selecting, and shift-clicking can be used toselect ranges.Normal termination is via the \sQuote{OK} button or by hitting Enter ordouble-clicking an item. Selection can be aborted via the\sQuote{Cancel} button or pressing Escape.#endif#ifdef unixUnder the Mac OS X GUI this brings up a modal dialog boxwith a (scrollable) list of items, which can be selected by the mouse.On other Unix-like platforms it will use aTcl/Tk listbox widget if possible.#endifIf \code{graphics} is FALSE or no graphical widget is available itdisplays a text list from which the user can choose by number(s). The\code{multiple = FALSE} case uses \code{\link{menu}}. Preselection isonly supported for \code{multiple = TRUE}, where it is indicated by a\code{"+"} preceding the item.It is an error to use \code{select.list} in a non-interactive session.}\value{A character vector of selected items. If \code{multiple} is false andno item was selected (or \code{Cancel} was used), \code{""} isreturned. If \code{multiple} is true and no item was selected (or\code{Cancel} was used) then a character vector of length 0 is returned.}\seealso{\code{\link{menu}}, \code{\link{tk_select.list}} for a graphicalversion using Tcl/Tk.}\examples{\dontrun{select.list(sort(.packages(all.available = TRUE)))}}\keyword{utilities}