Skip to content

Instantly share code, notes, and snippets.

@jhrcook
Created May 5, 2019 16:35
Show Gist options
  • Save jhrcook/b111ab0e8507ef48b35b96866870d203 to your computer and use it in GitHub Desktop.
Save jhrcook/b111ab0e8507ef48b35b96866870d203 to your computer and use it in GitHub Desktop.
Print to the start of the same line in R
for (letter in letters) {
cat(letter)
# do some work
Sys.sleep(0.1)
cat("\33[2K\r")
}
cat("done\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment