Skip to content

How to print console output statements from within script or function?

4 messages · jim holtman, Suresh_FSFM

#
Dear R-Experts,
Seek your help.

I am calling say 20 functions one by one in one script.
To reach the end, it takes approximately one hour.

While R is performing calculations, I would like to print console output
statements to track the progress.(e.g. "Result of function-1 is done")

Note: I have already tried "print" however, it did not work.

Thank you in advance.

Regards,
Suresh
#
Are you running on Windows?  Is our output buffered?   Are you using
the 'flush.console' function to make sure the output gets to the
console if buffereing is enabled?
On Sun, Feb 8, 2009 at 12:33 PM, Suresh_FSFM <suresh.ghalsasi at gmail.com> wrote:

  
    
#
Yes. I am running R on windows. 
However, I did not understand your question "Is our output buffered?"
No. I did not use flush.console function.

Suppose I am handling dataframe with 10 million rows, and performing some
calculations using "For loop" from row 1 to end, then where should I use
this flush.console?

Thank you.

Regards,
Suresh


Are you running on Windows?  Is our output buffered?   Are you using
the 'flush.console' function to make sure the output gets to the
console if buffereing is enabled?
#
On the Misc tab there is an option called Buffered Output.  I usually
have this unchecked so that output will go immediately to the console.
 You should put the flush.console() after the print functions that you
want to appear on the console.  If you are marking progress with the
print statement, put the flush.console after the print.  Are you
printing this out for each time through the loop for 10M rows?  You
might also want to check out the 'winProgressBar' function.
On Sun, Feb 8, 2009 at 3:06 PM, Suresh_FSFM <suresh.ghalsasi at gmail.com> wrote: