[R] How to print output during for loops?

IAIN GALLAGHER iaingallagher at btopenworld.com
Sun Oct 30 11:54:38 CET 2005


for (i in 1:5) {print(i)}

Cheers

Iain


--- Martin Lam <tmlammail at yahoo.com> wrote:

> Hi,
> 
> I was wondering, if it is possible to print out the
> values of variables while you are in a for/while
> loop?
> Like this for example:
>   
> for (i in 1:5) {
>   i
> }
> 
> So what I want is this as output in the console:
> >1
> >2
> >3
> >4
> >5
> 
> Thanks in advance,
> 
> Martin
> 
> ______________________________________________
> 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