tests/FileProgressBar.R

library("R.utils")

# Creates a progress bar (of length 100) that displays it self as a file.
pb <- FileProgressBar(file.path(tempdir(), "progress.simulation"))
reset(pb)
while (!isDone(pb)) {
  x <- rnorm(3e4)
  increase(pb)
  # Emulate a slow process
  Sys.sleep(0.001)
}

cleanup(pb)

Try the R.utils package in your browser

Any scripts or data that you put into this service are public.

R.utils documentation built on Nov. 18, 2023, 1:09 a.m.