progress: A progress bar function to run within a 'for' loop

Description Usage Arguments Examples

View source: R/progress.R

Description

This function should be ran within a for loop, it produces a progress bar to indicate how many iterations have passed

Usage

1
progress(i, n)

Arguments

i

A numeric value indicating the current iteration of the containing for loop

n

A numeric value indicating the total number of iterations of the containing for loop

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Set the number of iterations of the for loop
n <- 1000

for(i in 1:n){
 
  # Sleep for a tenth of a second
  Sys.sleep(0.01)
  
  # Update the progress bar
  progress(i, n)
}

JosephCrispell/plotteR documentation built on June 6, 2021, 7:24 p.m.