[R] cat and positioning of the output

Philippe Grosjean phgrosjean at sciviews.org
Thu Jun 29 22:30:15 CEST 2006


=?ANSI_X3.4-1968?Q?J=3Frn_Schulz?= wrote:
> Hello R users!
> 
> I like to use cat in a loop. I know, loops are not the best way in R ... but
> my question: It is possible to overwrite the expression "Reading row: i" in
> each iteration of the loop (print out in the below loop on the screen) or
> more particulary to overwrite the counter "i".

In package svMisc (SciViews bundle):

 > ?progress
 > example(progress)
Best,

Philippe Grosjean


> for(i in 1:header$M){
>    cat("Reading row: ", i)
>    SparseIndex[[i]] <- readBin( con, integer(), n=MIndexNumber[i], size=4 )
>    SparseSignal[[i]] <- readBin( con, numeric(), n=MIndexNumber[i], size=4 )
> }
> 
> Many thanks
> J?rn Schulz.



More information about the R-help mailing list