progress {svMisc}R Documentation

Display progression of a long calculation on the console

Description

Display progression level of a long-running task in the console. Two mode can be used: either percent of achievement (55%), or the number of items or steps done on a total (1 file on 10 done...).

Usage

progress(value, max.value = NULL)

Arguments

value ~~Describe value here~~
max.value ~~Describe max.value here~~

Details

The function uses backspace (\8) to erase characters at the console.

Value

This function returns NULL invisibly. It is invoked for its side effects.

Note

In a GUI, it is preferable to use a non modal dialog box with a progress widget, or to display such a progress widget in the status bar of your main window. See package 'tk2' for further information.

Author(s)

Philippe Grosjean <phgrosjean@sciviews.org>

Examples

        # 1) A simple progress indicator in %
        cat("\nSimple progress indicator in %:\n")
        for (i in 1:101) {
                progress(i)
                Sys.sleep(0.05)
        }
        cat("Done!\n")

        # 2) A progress indicator with 'x on y'
        cat("\nA variation...\n")
        for (i in 1:31) {
                progress(i, 30)
                Sys.sleep(0.2)
        }
        cat("Done!\n")

[Package svMisc version 0.9-5 Index]