progression_calculator: Creates a progression calculator which can display a loading...

View source: R/loading-animations.R

progression_calculatorR Documentation

Creates a progression calculator which can display a loading bar and expected time to completion

Description

Creates a progression calculator which can display a loading bar and expected time to completion

Usage

progression_calculator(task_description, N)

## S3 method for class 'progression_calculator'
render(object, i, interval = 10, ...)

Arguments

task_description

A description of the task which is executed, if set to NA then no description if printed when using the render() function

N

The number of steps that are needed to complete the task

object

A progression calculator

i

The current iteration.

interval

The number of iterations to be completed before the progression calculator is updated.

...

further arguments passed to or from other methods.

Examples

## Not run: 
#create progression calculator with 10 iterations
progress = progression_calculator("Example", N=10)
for(i in 1:10) {
  render(progress, i, interval=1) #render the calculator
  Sys.sleep(0.2)
}

## End(Not run)

hgutils documentation built on March 31, 2022, 5:06 p.m.