I'm seeing behavior I don't expect with the cat commands and flush.console() in RGui 2.12.0 (but not Rterm) for Windows. I wanted to see whether it was a problem with my system (or a known behavior) before reporting it as a bug. Specifically I'm seeing strange UNICODE looking characters as it iterates through. Please forgive the use of the huge rnorm() I couldn't figure out how to slow execution in an established way.
for (i in 1:100) {cat(i,"\r");flush.console();rnorm(1000000)}
R version 2.12.0 (2010-10-15)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
n <- 2.5; Sys.sleep(n)is a cheaper way to delay. Thetimeargument is in seconds and can be fractional, egSys.sleep(0.1)would sleep for (approximately) 100 milliseconds.