Create a progress bar function that displays the estimated time till
completion and optional messages. Call the returned functions set
or
inc
during a loop to change the display.
Note that you are not allowed to decrease the value of the bar.
If you call these function without setting any of the arguments
the bar is simply redrawn with the current value.
For errorhandling use error
and have a look at the example below.You can globally change the behavior of all bars by setting the option
options(BBmisc.ProgressBar.style)
either to text (the default)
or off, which display no bars at all.
You can globally change the width of all bars by setting the option
options(BBmisc.ProgressBar.width)
. By default this is getOption("width")
.
You can globally set the stream where the output of the bar is directed by setting the option
options(BBmisc.ProgressBar.stream)
either to stderr (the default)
or stdout. Note that using the latter will result in the bar being shown in
reports generated by Sweave or knitr, what you probably do not want.