ask                 package:runjags                 R Documentation

_O_b_t_a_i_n _I_n_p_u_t _f_r_o_m _U_s_e_r _W_i_t_h _E_r_r_o_r _H_a_n_d_l_i_n_g

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

     A simple function to detect input from the user, and keep
     prompting until a response matching the class of input required is
     given.

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

     ask(prompt="?", type="logical", bounds=c(-Inf, Inf), 
        na.allow=FALSE)

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

  prompt: what text string should be used to prompt the user?
          (character string)

    type: the class of object expected to be returned - "logical",
          "numeric", "integer", "character".  If the user input does
          not match this return, the prompt is repeated

  bounds: the lower and upper bounds of number to be returned.  Ignored
          if type is "logical" or "character"

na.allow: if TRUE, allows the user to input "NA" for any type, which is
          returned as NA

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

     Matthew Denwood m.denwood@vet.gla.ac.uk funded as part of the
     DEFRA VTRI project 0101.

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

     'readline', 'menu'

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

     #  Ask the user if they want to proceed
     ## Not run: 
     ask_yn("Do you want to start the program now?  ", type="logical")
     ## End(Not run)

