Re: [R] How to stop buffering of "cat"

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Thu, 01 May 2008 11:49:46 -0600

In addition to what others have pointed to regaurding buffering and cat, there are also a couple of new functions in R 2.7.0 that help with showing the progress of computations. They are winProgressBar (windows only) and TkProgressBar (in the tcltk package). You can use these to create and update a progress bar showing how far along you are. They also have options for labels and titles that you can use to show specific messages (or just percent finished). I prefer these to cat statements because you can make the window go away and don't have the messages from cat cluttering your output.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Vidhu Choudhary
> Sent: Wednesday, April 30, 2008 1:36 PM
> To: r-help_at_r-project.org
> Subject: [R] How to stop buffering of "cat"
>
> Hi All,
> My R code takes very long time to finish the processing. I
> want to see at what stage the script is running. So I wrote
> some output messages using cat.
> But instead of displaying the cat messages at different
> stages they are buffered and displayed in the end when entire
> processing is done.
> Can you please suggest how to stop this buffering or some
> alternative way to display messages
>
> Thank you
> Vidhu
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Thu 01 May 2008 - 18:24:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 01 May 2008 - 18:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive