new_progress_bar | R Documentation |
A simple progress bar. This function is used in MCMC when the function has been called with a single processor.
new_progress_bar(
n,
probs = c(0, 0.25, 0.5, 0.75, 1),
width = getOption("width", 80),
symbol = "/",
...
)
n |
Integer. Number of steps. |
probs |
Double vector. Quantiles where to put marks |
width |
Integer. Width of the bar in characters. |
symbol |
Character. Single character symbol to print each bar. |
... |
Further arguments passed to |
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.