[Rd] cat with backspace and newline characters

Philippe Grosjean phgrosjean at sciviews.org
Tue Nov 5 17:02:19 CET 2013


On 05 Nov 2013, at 14:22, Martin Maechler <maechler at stat.math.ethz.ch> wrote:

>>>>>> Kenn Konstabel <lebatsnok at gmail.com>
>>>>>>    on Tue, 5 Nov 2013 13:25:20 +0200 writes:
> 
>> I just tried it on ubuntu but within RStudio:
>>> cat("abc\b")
>> ab
>>> cat("abc\b\n")
>> ab
>>> sessionInfo()
> 
> which --- as you allude to below --- shows that  RStudio  has changed R
> in so far that it adds a '\n'  even when R, i.e.  cat()  does not.
> 
> I can understand that the RStudio programmers want to protect
> their users (*) from getting funny looking output,
> but I still don't like the fact that R inside RStudio is tweaked
> to behave differently from regular R. 
> 
> Martin Maechler, R Core Team & ETH Zurich
> 
> --
> (*) or their software from malfunctioning when the console "looks ugly"

[…]

I agree with you Martin, but what is a "regular R"? Because on a Mac, R.app does exactly the same as RStudio:

> cat("abc\b")
ab
> cat("abc\b\n")
ab
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

And this is R.app 1.62 Snow Leopard build (6558).

So, does it means that R run under R.app on Mac OS X is *not* considered as a regular R?
Best,

Philippe
 



More information about the R-devel mailing list