Simple Text Iteration Counter

iterCount(n = 100, i0 = 0L, title = "Iterations", extra = NULL, verbose = TRUE)

Arguments

n

number of total steps

i0

starting step

title

character string to use as title

extra

character vector providing extra text to add at each step

verbose

logical that toggles the counter

Examples

progress <- iterCount(LETTERS)
#> Iterations: 0/26 ()
res <- sapply(LETTERS, function(x){ Sys.sleep(.1) progress() })
#> Iterations: 1/26 (A)Iterations: 2/26 (B)Iterations: 3/26 (C)Iterations: 4/26 (D)Iterations: 5/26 (E)Iterations: 6/26 (F)Iterations: 7/26 (G)Iterations: 8/26 (H)Iterations: 9/26 (I)Iterations: 10/26 (J)Iterations: 11/26 (K)Iterations: 12/26 (L)Iterations: 13/26 (M)Iterations: 14/26 (N)Iterations: 15/26 (O)Iterations: 16/26 (P)Iterations: 17/26 (Q)Iterations: 18/26 (R)Iterations: 19/26 (S)Iterations: 20/26 (T)Iterations: 21/26 (U)Iterations: 22/26 (V)Iterations: 23/26 (W)Iterations: 24/26 (X)Iterations: 25/26 (Y)Iterations: 26/26 (Z)
# terminate counter i_end <- progress(NULL) i_end
#> [1] 26