menu(choices, graphics = F, title="")
TRUE
, a graphics menu
(for example, a pop-up menu) will be used if
the current graphics device supports one.
0
is returned.
For non-graphics menus, the user must respond with either
0
or a number
between
1
and
length(choices)
or a character string matching one of
the menu items.
This is a generic function; currently there are no methods written for it.
This function can only be used in interactive mode, see
interactive
for details on the exact conditions.
items <- c("List Objects", "quit") switch(menu(items)+1, cat("No Action\n"), ls(), q())