ursaProgressBar {ursa} | R Documentation |
Progress bar
Description
Informative progress bars with dispaying elapsed and remained time.
Usage
ursaProgressBar(kind = c("tk", "txt"),title = .argv0(),
label = "", min = 0, max = 1, initial = min, width = NA,
style = 1, tail = FALSE, silent = FALSE)
setUrsaProgressBar(pb, value, title = NULL, label = NULL)
## S3 method for class 'ursaProgressBar'
close(con, ...)
Arguments
kind |
Character. Type or progress bar. Valid values are |
style |
See description for the same argument in |
width |
See description for the same argument in |
title , label , min , max , initial , value , pb |
See description for the same arguments in |
con , ... |
See description for the same arguments in |
tail |
Logical. Behaviour of progress bar appearing. If |
silent |
Logical. If |
Details
Wrapper to one of
txtProgressBar
,
tkProgressBar
.
Visualization of progress bar is updates each 0.5 seconds, it is effective for multiple short-term iterations.
Progress bars should be closed by calling of appropriate method of generic function close
depending of class of reference progress bar.
Value
ursaProgressBar
returns object of reference progress bar.
Note
Function name in style camelCase for consistence with other progress bar functions in R.
Author(s)
Nikita Platonov platonov@sevin.ru
See Also
Examples
session_grid(NULL)
n1 <- 3
n2 <- 83
p <- 0.0011
#require(tcltk)
pb <- ursaProgressBar(min=0,max=n1,title="first",tail=TRUE)
for (i in seq(n1)) {
pb2 <- ursaProgressBar(min=0,max=n2,title="second")
for (i in seq(n2)) {
setUrsaProgressBar(pb2)
Sys.sleep(p)
}
close(pb2)
setUrsaProgressBar(pb)
}
close(pb)