set_counter: Set a counter which represents the percentage finished in a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/common_utils.R

Description

Set a counter which represents the percentage 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. "%s" will be replaced with the percent string generated by the counter.

Details

The counter function should be executed in every iteration in the loop. The message only shows in interactive R session.

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()}

jokergoo/epik documentation built on Sept. 28, 2019, 9:20 a.m.