A simple progress bar. This function is used in MCMC when the function has been called with a single processor.
Integer. Number of steps.
Double vector. Quantiles where to put marks
Integer. Width of the bar in characters.
Character. Single character symbol to print each bar.
Further arguments passed to cat()
such as file
and append
.
A function that can be included at the interior of a loop to
mark the progress of the loop. It receives a single argument, i
,
which is the number of the current step.
x <- new_progress_bar(20)
for (i in 1:20) {
Sys.sleep(2/20)
x(i)
}
#>
#> |0% |25% |50% |75% 100%|
#> --------------------------------------------------------------------------------
#> ////////////////////////////////////////////////////////////////////////////////