Skip to content

Instantly share code, notes, and snippets.

@jilmun
Created March 12, 2016 15:15
Show Gist options
  • Save jilmun/872afd1dcb871a949a58 to your computer and use it in GitHub Desktop.
Save jilmun/872afd1dcb871a949a58 to your computer and use it in GitHub Desktop.
# 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