Skip to content
Prev 284100 / 398502 Next

Clear last x entries of R console

On 12-02-03 9:00 AM, angliski_jigit wrote:
Just don't write out a newline.  E.g.

for (i in 1:10) {
   cat(".")
   flush.console()
   Sys.sleep(1)
}

You can write out a CR using \r if you want to overwrite the previous 
line, e.g.

for (i in 10:0) {
   cat(i, " \r")
   flush.console()
   Sys.sleep(1)
}


Duncan Murdoch