-
-
Save cgpu/8a0e59f47c9c2b12778548d92f6b52a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # print everything after loop is finished | |
| for (i in 0:101) { | |
| print(i) | |
| Sys.sleep(0.01) | |
| } | |
| # simplist way to print within loop | |
| for (i in 0:101) { | |
| print(i) | |
| Sys.sleep(0.01) | |
| flush.console() | |
| } | |
| # fancier text progress | |
| # install.packages("svMisc") | |
| require(svMisc) | |
| for (i in 0:101) { | |
| progress(i) | |
| Sys.sleep(0.01) | |
| if (i == 101) cat("Done!\n") | |
| } | |
| # fancier text progress with bar | |
| # install.packages("svMisc") | |
| require(svMisc) | |
| for (i in 0:101) { | |
| progress(i, progress.bar = TRUE) | |
| Sys.sleep(0.01) | |
| if (i == 101) cat("Done!\n") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment