Skip to content

\r in R.app console

2 messages · Brian Ripley, Byron Ellis

#
I discovered empirically that cat("\r") in the R.app console emits a 
newline: is that intentional?  It is the only way of running R I have 
found for which that is true.  (The R Windows GUI and all terminals, even 
on Mac OS, just move to the beginning of the line.)

The reason for testing was txtProgressBar() in pre-2.7.0, which expects \r 
to do a carriage return, only (as documented in ?Quotes).  I could change 
this to use backspaces (less reliably), but it would seem better to make 
the console consistent with the documentation and e.g. Terminal.
#
That's probably because NSTextView behaves more like Classic MacOS
where \r was the newline character rather than \n or \r\n. I'm not
sure there's a straightforward way of changing that behavior without
some pretty big changes to NSTextView.
On Thu, Apr 3, 2008 at 5:46 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: