From maechler at stat.math.ethz.ch  Tue Nov  5 17:53:35 2013
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 5 Nov 2013 17:53:35 +0100
Subject: [Rd] cat with backspace and newline characters
In-Reply-To: <8E2469B4-2A7B-44DD-896F-F409C39F4496@sciviews.org>
References: <CAHavPHGe1A7R6RxD45exQnq7zJXWatiKQ8rR7SiFJBE2RGVQDQ@mail.gmail.com>
	<CADv2QyG6Nvn+YJ46Pz5PF7FqB9Q-LnEeLE4_EAgfVgBKo+EakA@mail.gmail.com>
	<CAHavPHH7VMYxBLjJsDO_2wwS-tC=gwbHiMfXVeP4fhXPZiJwNg@mail.gmail.com>
	<CAH7sKSN6a7ObU8g7xXf+fHq0cdMeKvsr7PSsorhNZ=DP3Pf8Ow@mail.gmail.com>
	<21112.61708.698124.149056@stat.math.ethz.ch>
	<8E2469B4-2A7B-44DD-896F-F409C39F4496@sciviews.org>
Message-ID: <21113.8847.603856.486049@stat.math.ethz.ch>

>>>>> "PhGr" == Philippe Grosjean <phgrosjean at sciviews.org>
>>>>>     on Tue, 5 Nov 2013 17:02:19 +0100 writes:

    PhGr> On 05 Nov 2013, at 14:22, Martin Maechler
    PhGr> <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"

    PhGr> [?]

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

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

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

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

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

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

good question....  I would have said so, but maybe we should
wait for my R core colleagues for a bit.... ;-)

Martin


    PhGr> Best, Philippe



[Rd] cat with backspace and newline characters
Martin Maechler