selectCore             package:goCluster             R Documentation

_A _m_e_n_u _f_u_n_c_t_i_o_n

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

     The function generates a generic textual menu that will return the
     choice of the user.

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

     selectCore(message,
     convert = function(X) X,
     check = function(X) TRUE,
     options = NULL,
     error = function(X) return("Invalid choice!"),
     ...
     )

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

 message: The informational message that will be shown together with
          the menu.

 convert: A function that converts the user input to a desired format
          or class type.

   check: A function that checks the user input for validity.

 options: The available options as character vector, if any.

   error: The function that should be executed in case of an error.
          This should deliver a message that is useful to the user.

     ...: Additional arguments for the convert, check and error
          functions. 

_D_e_t_a_i_l_s:

     selectCore is a function that provides a generic menu. Currently
     this is a simple textual menu but it could be extended to a
     graphical version. The function needs a message that should be
     displayed to the user, a function to convert the user input to a
     desired format and another function to check the validity of the
     user input. Finally a set of options that should be displayed to
     the user as a numbered list can be specified as a character
     vector. If 'convert' is not specified, the user input will be used
     as given (string format) and if 'check' is left unspecified, the
     check will always return TRUE.

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

     The choice of the user in the format returned by the convert
     function.

_A_u_t_h_o_r(_s):

     Gunnar Wrobel, <URL: http://www.gunnarwrobel.de>.

_S_e_e _A_l_s_o:

     'selectOption', 'selectDouble', 'selectNumber'.

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

     ## This example needs to be commented since it needs user input
     ## and would prevent R CMD check from running. Please remove the comment
     ## in the following line to run the example.

     ## selectCore("Please choose a number between 0 and 10",convert=function(X) as.integer(X), check=function(X) (X > 0 & X < 10))

