progressBar               package:time               R Documentation

_D_r_a_w _a_n_d _u_p_d_a_t_e _a _p_r_o_g_r_e_s_s _b_a_r

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

     'progressBar' is initially called to draw the framework of the
     progress bar, then called during each iteration to update the
     number of bars, if needed.

     The return value of 'progressBar' should always be stored, then
     passed as the 'prev' argument to the next call to 'progressBar'.

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

     progressBar(prop = 0, prev = 0)

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

    prop: Specify the proportion of progress accomplished.

    prev: The number of bars already drawn, the return value 'prev'
          obtained from the last call to 'progressBar'.

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

     The number of bars drawn already, to be passed as the 'prev'
     argument to the next call to 'progressBar'.

_N_o_t_e:

     The current line of the terminal needs to be empty for
     'progressBar' to be drawn properly. Just make sure the last
     printed character was an end of line character, '"\n"'.

     Another assumption that 'progressBar' makes is that it will be the
     only thing drawing to the terminal during the duration of calls to
     it. For proper appearance, no other drawing to the terminal should
     be done until 'progressBar' is called with 'prop >= 1', which it
     takes as the signal that the analysis task is complete.

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

     Toby Dylan Hocking <tobob@berkeley.edu>

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

     n <- 5000
     prev <- progressBar()
     for( i in 1:n ) {
         #TimeConsumingAnalysisTask
         prev <- progressBar(i/n,prev)
     }

