Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A countdown timer in the R console (beware: it clears the console first)
# See Colin Fay's tweet
countdown <- function(s) {
cat("\014") # clear console
for (i in rev(seq(s))) {
cat("Countdown:", i, "s\n")
cat(paste0("Countdown complete (", s, " seconds)"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment