progress_bar: Create a R6 progress bar directly

Description Usage Arguments Examples

View source: R/progress_bar.R

Description

Create a R6 progress bar directly

Usage

1
2
progress_bar(total, title = "Progress", ...,
  type = getOption("progress.type", infer_type()))

Arguments

total

the total number of elements

title

the title of the progress bar

...

passed on to the specific constructor determined by type.

type

the type of progress bar to create as a string, or an R6ClassGenerator object for a class that inherits from the "R6 Progress Base Class".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pb_win <- progress_bar(100, "Windows Progress", type = 'win')

pb_txt <- progress_bar(100, "Text Progress", type = 'txt')
pb_txt$init() # starts the timer and shows the bar.
pb_txt$step() # take 1 step update progress bar.
pb_txt$step(25) # take 24 steps at one time
pb_txt$term() # do finishing tasks for progress bar.

# The following use Unicode characters and may not work with all fonts.
# DejaVu Sans Mono is one font which supports all the characters used
pb_bar   <- progress_bar(100, "Bar Progress", type = 'bar')
pb_line  <- progress_bar(100, "Line Progress", type = 'line')
pb_box   <- progress_bar(100, "Box Progress", type = 'box')
pb_block <- progress_bar(100, "Block Progress", type = 'block')

purrrogress documentation built on July 23, 2019, 1:04 a.m.