[R] cat in windows vs linux

Marc Schwartz mschwartz at medanalytics.com
Tue Feb 25 16:47:57 CET 2003

>-----Original Message-----
>From: r-help-admin at stat.math.ethz.ch 
>[mailto:r-help-admin at stat.math.ethz.ch] On Behalf Of rob foxall (IFR)
>Sent: Tuesday, February 25, 2003 9:17 AM
>To: 'r-help at stat.math.ethz.ch'
>Subject: [R] cat in windows vs linux
>Hi all,
>	Easy question for you (which I failed to find the 
>answer to in the FAQ etc). I've recently been forced to switch 
>from linux to windows (currently windows NT), and my usual 
>habit of putting lots of "cat" statements in slow functions to 
>get an idea of the progress rate is no longer useful. Why -- 
>because R waits until the function is completely finished 
>before printing the cat statements all at once to the screen. 
>Don't know if this is an R thing or a windows thing, but if 
>there is a way to get cat statements printed to the screen as 
>soon as the function calls it, I'd like to hear it! Using R 
>version 1.6.2.
>	Rob.

You might wish to try to turn off "buffered output", which is on the
"Misc" menu in Rgui.

BTW, this is in the R Windows FAQ:

6.3 When using Rgui the output to the console seems to be delayed.

This is deliberate: the console output is buffered and re-written in
chunks to be faster and less distracting. You can turn buffering off
or on from the `Misc' menu or the right-click menu: <Ctrl-W> toggles
the setting.

If you are sourcing R code or writing from a function, there is
another option. A call to the R function flush.console() will write
out the buffer and so update the console.


Marc Schwartz

More information about the R-help mailing list