Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

progress.meter

Monitor the progress of a repetitive calculation.


Description

progress.meter writes a symbol to the output at each invocation. The symbol is usually a ".", a "+" if i %% == 0, and (i %/% 10) %% 10 if i %% 10 == 0. If i %% 50 == 0, a line break will be written and i printed.

Usage

progress.meter(i) # inside a function or loop

Arguments

i

Integer.

Value

invisible(NULL).

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>

Examples

n <- 1 # adjust
  for (i in 0:250) {
    kk <- 0
    for (mm in 1:10^n) {
      kk <- kk+1  # do something time consuming
    }
    progress.meter(i)
  }
  cat("")
#    0....+....1....+....2....+....3....+....4....+....
#   50....+....6....+....7....+....8....+....9....+....

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.