[R] Sweave counter

Ista Zahn istazahn at gmail.com
Tue May 18 19:31:49 CEST 2010


Hi Jimmy,
You can use message() instead of cat():

if (i%%100==0) message(i)

Best,
Ista

On Tuesday 18 May 2010 1:10:51 pm Jimmy Söderly wrote:
> Dear R users,
> 
> I am using the Sweave package and I am doing some MCMC. I have a loop
> function for my MCMC. Every 100 iterations, I want the number of iterations
> already done to appear on my screen (but not on the final document). Is
> that possible ?
> 
> Usually I can rely on
> 
> > if (i%%100==0) cat(i, "\n")
> 
> but not when using Sweave.
> 
> Thanks for your help,
> Jimmy
> 
> 	[[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.



More information about the R-help mailing list