Skip to content

Instantly share code, notes, and snippets.

@simonrolph
Created September 21, 2022 08:47
Show Gist options
  • Save simonrolph/00f6aa54855b65ace644d1f76179cd30 to your computer and use it in GitHub Desktop.
Save simonrolph/00f6aa54855b65ace644d1f76179cd30 to your computer and use it in GitHub Desktop.
Percentage progress in a loop for R
n <- 1004
for(i in 1:n){
Sys.sleep(0.2
cat("\r",round(i/n*100,2),"%")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment