ProgressBar | R Documentation |
Package: R.utils
Class ProgressBar
Object
~~|
~~+--
ProgressBar
Directly known subclasses:
FileProgressBar
public static class ProgressBar
extends Object
ProgressBar(max=100, ticks=10, stepLength=1, newlineWhenDone=TRUE)
max |
The maximum number of steps. |
ticks |
Put visual "ticks" every |
stepLength |
The default length for each increase. |
newlineWhenDone |
If |
Methods:
as.character | - | |
getBarString | - | |
increase | - | |
isDone | - | |
reset | - | |
setMaxValue | - | |
setProgress | - | |
setStepLength | - | |
setTicks | - | |
setValue | - | |
update | - | |
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save
Henrik Bengtsson
# A progress bar with default step length one.
pb <- ProgressBar(max=42)
reset(pb)
while (!isDone(pb)) {
x <- rnorm(3e4)
increase(pb)
# Emulate a slow process
if (interactive()) 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)
# Emulate a slow process
if (interactive()) Sys.sleep(0.02)
}
cat("\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.