spinner: Creates an animated spinner

Description Usage Arguments Details Examples

View source: R/loading-animations.R

Description

Creates an animated spinner

Usage

1
2
3
4
spinner(format = "|/-\\", refresh = 200)

## S3 method for class 'spinner'
render(object, ...)

Arguments

format

character vector containing the format of the animation. See 'details' for more information.

refresh

refresh rate in milliseconds of the animation.

object

animated spinner.

...

further arguments passed to or from other methods.

Details

The format of the spinner simply consists of the characters in order which the spinner cycles through.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
sp = spinner("|/-\\")
n_operations = 100

for(i in 1:n_operations) {
  cat("\r", render(sp),sep="")
  Sys.sleep(0.01)
}
## End(Not run)

hgvandenboorn/hgutils documentation built on Sept. 9, 2019, 2:50 a.m.