progress                package:prada                R Documentation

_A _s_i_m_p_l_e _t_c_l_t_k _p_r_o_g_r_e_s_s _w_i_n_d_o_w

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

     Show progress of a task in a tcltk window as percentage

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

       progress(title="processing task...", message="", sub="")
       updateProgress(percentage, autoKill=FALSE, sub="")
       killProgress()

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

   title: The title of the tcltk window

 message: A short test message to add to the window

     sub: An additional text field that can be updated
          via'updateProgress'

percentage: An integer giving the percentage of completion

autoKill: Logical indicating whether to kill the display after 100 is
          reached

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

     Function 'progress' creates the progress window and sets up the
     necessary environment. 'updateProgress' takes as argument an
     integer value indicating the percentage of completion and updates
     the display. The integer value that gets passed to
     'updateProgress' will usually be generated by an iterator (e.g. in
     a for loop). 'killProgress' may be called explicitely to kill the
     progress window. Alternatively one can set the argument autoKill
     of 'updateProgress' to 'TRUE' to automatically kill the window
     once a value of 100 is reached.

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

     The functions are called for their side effects.

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

     Florian Hahne

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

     if(interactive()){
       progress(message="This is a progress display...", sub="(step 1 of 50)")
       for(i in 1:50) {
          zz = rnorm(1e5)
          updateProgress(i*2, autoKill=TRUE, sub=paste("(step", i, "of 50)"))
       }
     }

