How to output text in the R console without creating new lines?
Use cat()
instead of print()
:
cat("0%")cat("..10%")
Outputs:
0%..10%
Bah, Andrie beat me to it by 28 seconds.
> for (i in 1:10) {+ cat(paste("..", i, ".."))+ }.. 1 .... 2 .... 3 .... 4 .... 5 .... 6 .... 7 .... 8 .... 9 .... 10 ..
Maybe you can yse plyr
l_ply(1:4,function(x) x+1,.progress= progress_text(char = '+'),.print=TRUE) | | 0%[1] 2 |++++++ | 25%[1] 3 |+++++++++++++++ | 50%[1] 4 |++++++++++++++++++++++ | 75%[1] 5 |++++++++++++++++++++++++++++++++ | 100%[1]