msgProgressBar is an equivalent to use txtProgressBar but uses message()
instead of cat to print out the progress bar. This is good to use in R packages or in functions where one would like to supresse the progressbar using suppressMessages()
.
Currently the package is not on CRAN. Please install directly from github:
devtools::install_github("MansMeg/msgProgressBar")
> test_bar <- function(i = 10){
+ bar <- msgProgressBar::msgProgressBar(i)
+ for(j in 1:i){
+ bar$increment()
+ Sys.sleep(4/i)
+ }
+ }
> test_bar(100)
| 25% 50% 75% |
|=======================================================================================|
Author: Måns Magnusson
You are welcome to contact:
* submit suggestions and bug reports (provide the output of sessionInfo()
and packageVersion("msgProgressBar")
)
* [send a pull request]((https://github.com/MansMeg/msgProgressBar/)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.