menu                  package:utils                  R Documentation

_M_e_n_u _I_n_t_e_r_a_c_t_i_o_n _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     '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
     select '0'.

_U_s_a_g_e:

     menu(choices, graphics = FALSE, title = "")

_A_r_g_u_m_e_n_t_s:

 choices: a character vector of choices

graphics: a logical indicating whether a graphics menu should be used. 
          Currently unused.

   title: a character string to be used as the title of the menu

_V_a_l_u_e:

     The number corresponding to the selected item, or 0 if no choice
     was made.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     switch(menu(c("List letters", "List LETTERS")) + 1,
            cat("Nothing done\n"), letters, LETTERS)
     ## End(Not run)

