| print_loop_progress | R Documentation |
Print current progress inside a loop (e.g., for loop or lapply)
print_loop_progress( iteration_number = NULL, iteration_start = 1, iteration_end = NULL, text_before = "", percent = 1, output_method = "cat" )
iteration_number |
current number of iteration |
iteration_start |
iteration number at which the loop begins (default = 1) |
iteration_end |
iteration number at which the loop ends. |
text_before |
text to add before "Loop Progress..."
By default, it is set to be blank, i.e., |
percent |
if |
output_method |
if |
for (i in seq_len(250)) {
Sys.sleep(0.001)
print_loop_progress(
iteration_number = i,
iteration_end = 250)
}
unlist(lapply(seq_len(7), function (i) {
Sys.sleep(0.1)
print_loop_progress(
iteration_number = i,
iteration_end = 7)
return(i)
}))