menu presents the user with a menu of choices labelled from 1
to the number of choices. To exit without choosing an item one can
menu(choices, graphics = FALSE, title = NULL)
a character vector of choices
a logical indicating whether a graphics menu should be used if available.
a character string to be used as the title of the menu.
graphics = TRUE and a windowing system is available
(Windows, macOS or X11 via Tcl/Tk) a listbox widget is
used, otherwise a text menu. It is an error to use
menu in a
Ten or fewer items will be displayed in a single column, more in multiple columns if possible within the current display width.
No title is displayed if
The number corresponding to the selected item, or 0 if no choice was made.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
select.list, which is used to implement the graphical
menu, and allows multiple selections.
## Not run: switch(menu(c("List letters", "List LETTERS")) + 1, cat("Nothing done\n"), letters, LETTERS) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.