Hoi Peter,

--On woensdag 4 juni 2003 0:16 +0200 Peter Dalgaard BSA <[EMAIL PROTECTED]> wrote:

"Gilda Garibotti" <[EMAIL PROTECTED]> writes:

Hi,
I would like to know if it is possible to get printed output while a
loop is taking place. Example:
for(i in 1:10){
 print(i)
 some long process
}

This will print the values of i only after the loop is finished, what I
would like is to  see them when the process enters the i-th iteration to
keep track of how the  program is running.

Windows, right? (This is system dependent) There's a menu item entitled "Buffer output" or something to that effect. Turn it off and print() calls display immediately. Lengthy output becomes slower, though.

If you don't want to depend on you (or other people) turning of the buffering, use something like

cat("this or that"); flush.console.


regards, Paul


-- Paul Lemmens NICI, University of Nijmegen ASCII Ribbon Campaign /"\ Montessorilaan 3 (B.01.03) Against HTML Mail \ / NL-6525 HR Nijmegen X The Netherlands / \ Phonenumber +31-24-3612648 Fax +31-24-3616066

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to