Here is one way by using 'cat' and doing a 'return' before writing:

# writing in same location
for (i in 1:3){
    cat("\r", format(Sys.time()))
    flush.console()
    Sys.sleep(1)
}



Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Thu, Jun 12, 2014 at 7:04 AM, Jorge I Velez <jorgeivanve...@gmail.com>
wrote:

> Dear Juan,
>
> Perhaps the last example in
> http://stat.ethz.ch/R-manual/R-devel/library/utils/html/txtProgressBar.html
> is what you are looking for.
>
> Best,
> Jorge.-
>
>
> On Thu, Jun 12, 2014 at 8:49 PM, Juan Andres Hernandez <
> jhernandezcabr...@gmail.com> wrote:
>
> > Hi I need to print the iteration number of a procedure but in the same
> > location in console. Using cat with or without fill argument does not
> > produce the desired outcome. Does anybody know how to get it?.
> >
> > for(i in 1:10) cat('Iteration:',i,fill=T)
> >
> > Thank's in advance
> > Juan A. Hernandez
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@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.
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to