[R] cat function within a loop

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.ac.be
Tue Oct 5 17:10:32 CEST 2004


Just press Ctrl+W (it controls buffered output) if you are using the 
RGui.

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Tatsuki Koyama" <Tatsuki.Koyama at Vanderbilt.edu>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, October 05, 2004 4:48 PM
Subject: [R] cat function within a loop


>I have a 'cat' function within a for loop.
> I would like it to print out the result everytime it goes through 
> the
> for loop so that I can monitor the progress, but it only prints out
> (execute the cat function) once at the very end of the for loop.
> A simple example:
>
> for(i in 1:100000){
> cat(i, '\n')
> }
>
> What should I do in order for the cat function to be executed
> everytime it goes thorough the for loop?
> Thanks!
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list