From maechler at stat.math.ethz.ch  Tue Nov  5 14:50:04 2013
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 5 Nov 2013 14:50:04 +0100
Subject: [Rd] cat with backspace and newline characters
In-Reply-To: <5278F2E6.5070200@braverock.com>
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>
	<5278F2E6.5070200@braverock.com>
Message-ID: <21112.63372.152443.397235@stat.math.ethz.ch>

>>>>> Brian G Peterson <brian at braverock.com>
>>>>>     on Tue, 5 Nov 2013 07:30:14 -0600 writes:

    > On 11/05/2013 07:22 AM, Martin Maechler wrote:
    >> 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.

    > No, it just suggests exactly what Prof. Ripley alluded
    > to...

    > ... the output of cat() will be dependent on the display
    > terminal.

    > RStudio doesn't include R at all, and in fact makes use of
    > the/any R binary installed via other processes.  It is not
    > 'tweaked'.

    > It *does* include a 'terminal' to display the interactions
    > with the R console.

Well I know that (it does not modify R),
but I'd say that the above is just another way to say what I said:
RStudio tweaks R's output. I agree that this is much much less
problematic than changing R objects, but I'd claim that
where as the interpretation of  \b  depends on the
terminal/console (and so it is quite rarely used),
the functioning of  \n  should not depend on the platform.
RStudio users may conclude that it is a good idea to use things like
	cat("pi:", pi)
whereas they really should use something like
	cat("pi:", pi, "\n)

Martin

    > Regards,
    > Brian



[Rd] cat with backspace and newline characters
Martin Maechler