ask                  package:gtools                  R Documentation

_D_i_s_p_l_a_y _a _p_r_o_m_p_t _a_n_d _c_o_l_l_e_c_t _t_h_e _u_s_e_r'_s _r_e_s_p_o_n_s_e

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

     Display a prompt and collect the user's response

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

     ask(msg = "Press <RETURN> to continue: ")

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

     msg: Character vetor providing the message to be displayed

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

     The prompt message will be displayed, and then 'readLines' is used
     to collect a single input value (possibly empty), which is then
     returned.

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

     A character scalar containing the input providede by the user.

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

     Gregory R. Warnes greg@random-technologies-llc.com

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

     'readLines', 'scan'

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

     # use default prompt
     ask()

     silly <- function()
     {
        age <- ask("How old aroe you? ")
        age <- as.numeric(age)
        cat("In 10 years you will be", age+10, "years old!\n")
     }
        

