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 ..