ProgressBar

0th

Percentile

Provides text based counting progress bar

Package: R.utils Class ProgressBar Object ~~| ~~+--ProgressBar Directly known subclasses: FileProgressBar public static class ProgressBar extends Object

Keywords
classes
Usage
ProgressBar(max=100, ticks=10, stepLength=1, newlineWhenDone=TRUE)
Arguments
max
The maximum number of steps.
ticks
Put visual "ticks" every ticks step.
stepLength
The default length for each increase.
newlineWhenDone
If TRUE, a newline is outputted when bar is updated, when done, otherwise not.
Fields and Methods

Methods: rll{ as.character Gets a string description of the progress bar. getBarString Gets the progress bar string to be displayed. increase Increases (steps) progress bar. isDone Checks if progress bar is completed. reset Reset progress bar. setMaxValue Sets maximum value. setProgress Sets current progress. setStepLength Sets default step length. setTicks Sets values for which ticks should be visible. setValue Sets current value. update Updates progress bar. }

Methods inherited from Object: $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, gc, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, objectSize, print, save

Aliases
  • ProgressBar
Examples
# 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("")

# 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("")
Documentation reproduced from package R.utils, version 1.28.4, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.