This is a convenient function for reporting progress
during an iterative sequence of calculations
or a suite of simulations. If style="tk"
then tcltk::tkProgressBar
is
used to pop-up a new graphics window showing a progress bar.
This requires the package tcltk.
If style="txtbar"
then txtProgressBar
is
used to represent progress as a bar made of text characters in the
Rinterpreter window.
If style="tty"
, then progress reports are printed using
cat
. This only seems to work well under Linux.
It is optional, but strongly advisable, to use the argument state
to store and update the internal data for the progress reports
(such as the cumulative time taken for computation)
as shown in the last example below.
This avoids conflicts with other programs that might be
calling progressreport
at the same time.