ProgressBar             package:R.utils             R Documentation

_P_r_o_v_i_d_e_s _t_e_x_t _b_a_s_e_d _c_o_u_n_t_i_n_g _p_r_o_g_r_e_s_s _b_a_r

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

     Package:  R.utils 
      *Class ProgressBar*

     'Object'
      '~~|'
      '~~+--''ProgressBar'

     *Directly known subclasses:*
      FileProgressBar

     public static class *ProgressBar*
      extends Object

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

     ProgressBar(max=100, ticks=10, stepLength=1, newlineWhenDone=TRUE)

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

     max: The maximum number of steps.

   ticks: Put visual "ticks" every 'ticks' step.

stepLength: The default length for each increase.

newlineWhenDone: If 'TRUE', a newline is outputted when bar is updated,
          when done, otherwise not.

_F_i_e_l_d_s _a_n_d _M_e_t_h_o_d_s:

     *Methods:*

         'as.character'   Gets a string description of the progress bar.
         'getBarString'   Gets the progress bar string to be displayed.
         'increase'       Increases (steps) progress bar.
         'isDone'         Checks if progress bar is completed.
         'reset'          Reset progress bar.
         'setMaxValue'    Sets maximum value.
         'setProgress'    Sets current progress.
         'setStepLength'  Sets default step length.
         'setTicks'       Sets values for which ticks should be visible.
         'setValue'       Sets current value.
         'update'         Updates progress bar.

     *Methods inherited from Object*:
      $, $<-, [[, [[<-, as.character, attach, attachLocally,
     clearCache, clone, detach, equals, extend, finalize, gc,
     getEnvironment, getFields, getInstanciationTime,
     getStaticInstance, hasField, hashCode, ll, load, objectSize,
     print, save

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

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

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

     # A progress bar with default step length one.
     pb <- ProgressBar(max=42)
     reset(pb)
     while (!isDone(pb)) {
       x <- rnorm(3e4)
       increase(pb)
       Sys.sleep(0.02)
     }
     cat("\n")

     # A "faster" progress bar with default step length 1.4.
     pb <- ProgressBar(max=42, stepLength=1.4)
     reset(pb)
     while (!isDone(pb)) {
       x <- rnorm(3e4)
       increase(pb)
       Sys.sleep(0.02)
     }

     cat("\n")

