set_counter: Set a counter which represents percent finished in a loop

Description Usage Arguments Details Value Author(s) Examples

Description

Set a counter which represents percent finished in a loop

Usage

1
set_counter(n, fmt = "%s")

Arguments

n

number of iteration in a loop.

fmt

format of the message, pass to sprintf. "%" will be replaced with the percent string generated by the counter.

Details

The counter function should be executed in every iteration in the loop.

Value

A counter function.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
4
counter = set_counter(1000)
for(i in 1:1000) {counter()}
counter = set_counter(1000, fmt = "processing %s")
for(i in 1:1000) {counter()}

eilslabs/epic documentation built on May 16, 2019, 1:24 a.m.