title: Printing repetetively on the same line in R
body: <p>I was just wondering what is the best way in R to keep on printing on the same line in a loop, to avoid swamping your console? Let's say to print a value indicating your progress, as in</p>
  
  <pre><code>for (i in 1:10) {print(i)}
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I tried inserting carriage returns before each value as in</p>
  
  <pre><code>for (i in 1:10000) {cat("\r",i)}
  </code></pre>
  
  <p>but that also doesn't quite work as it will just update the value on the screen after the loop, just returning 10000 in this case.... Any thoughts?</p>
  
  <p>NB this is not to make a progress bar, as I know there are various features for that, but just to be able to print some info during the progression of some loop without swamping the console</p>