tcltkProgress: A simple tcltk progress window

Description Usage Arguments Details Value Author(s) Examples

Description

Show progress of a task in a tcltk window as percentage

Usage

1
2
3
  progress(title="processing task...", message="", sub="")
  updateProgress(percentage, autoKill=FALSE, sub="")
  killProgress()

Arguments

title

The title of the tcltk window

message

A short test message to add to the window

sub

An additional text field that can be updated viaupdateProgress

percentage

An integer giving the percentage of completion

autoKill

Logical indicating whether to kill the display after 100 is reached

Details

Function progress creates the progress window and sets up the necessary environment. updateProgress takes as argument an integer value indicating the percentage of completion and updates the display. The integer value that gets passed to updateProgress will usually be generated by an iterator (e.g. in a for loop). killProgress may be called explicitely to kill the progress window. Alternatively one can set the argument autoKill of updateProgress to TRUE to automatically kill the window once a value of 100 is reached.

Value

The functions are called for their side effects.

Author(s)

Florian Hahne

Examples

1
2
3
4
5
6
7
if(interactive() && capabilities()["tcltk"]){
  progress(message="This is a progress display...", sub="(step 1 of 50)")
  for(i in 1:50) {
     zz = rnorm(1e5)
     updateProgress(i*2, autoKill=TRUE, sub=paste("(step", i, "of 50)"))
  }
}

prada documentation built on April 28, 2020, 7:52 p.m.