Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread Prof J C Nash (U30A)
Over the years, this has been useful to me (not just in R) for many nonlinear optimization tasks. The alternatives often clutter the screen. > On 13-11-06 06:00 AM, r-devel-requ...@r-project.org wrote: > People do sometimes use this pattern for displaying progress (e.g. iteration > counts). >>

Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread peter dalgaard
On 07 Nov 2013, at 10:13 , Barry Rowlingson wrote: > On Thu, Nov 7, 2013 at 8:28 AM, Jari Oksanen wrote: >> >> On 07/11/2013, at 09:35 AM, Renaud Gaujoux wrote: >> >>> I agree that the handling of \b is not that strange, once one agrees >>> on what \b actually means, i.e. "go back one charac

Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread Barry Rowlingson
On Thu, Nov 7, 2013 at 8:28 AM, Jari Oksanen wrote: > > On 07/11/2013, at 09:35 AM, Renaud Gaujoux wrote: > >> I agree that the handling of \b is not that strange, once one agrees >> on what \b actually means, i.e. "go back one character" and not >> "delete previous character". It means, to parap

Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread Jari Oksanen
On 07/11/2013, at 09:35 AM, Renaud Gaujoux wrote: > I agree that the handling of \b is not that strange, once one agrees > on what \b actually means, i.e. "go back one character" and not > "delete previous character". > The fact that R GUI on Mac and Windows interprets/renders it > differently sh

Re: [Rd] cat with backspace and newline characters

2013-11-06 Thread Renaud Gaujoux
I agree that the handling of \b is not that strange, once one agrees on what \b actually means, i.e. "go back one character" and not "delete previous character". The fact that R GUI on Mac and Windows interprets/renders it differently shows that normality and strangeness is quite relative though.

Re: [Rd] cat with backspace and newline characters

2013-11-06 Thread Simon Urbanek
On Nov 6, 2013, at 3:47 AM, Renaud Gaujoux wrote: >> Anyway, >> thanks for all the experiments, and (to Renaud) support.rstudio.org is >> the place to report such problems. >> > > Funny how the post diverged to an RStudio-related issue. > Anyway, I posted a link to this post at support.rstudi

Re: [Rd] cat with backspace and newline characters

2013-11-06 Thread Renaud Gaujoux
> Anyway, > thanks for all the experiments, and (to Renaud) support.rstudio.org is > the place to report such problems. > Funny how the post diverged to an RStudio-related issue. Anyway, I posted a link to this post at support.rstudio.org: http://support.rstudio.org/help/discussions/problems/9242-

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Yihui Xie
Yes, that indeed sounds like a problem, but example(txtProgressBar), which is based on \r, works well in the RStudio console. Anyway, thanks for all the experiments, and (to Renaud) support.rstudio.org is the place to report such problems. Regards, Yihui -- Yihui Xie Web: http://yihui.name Depart

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread peter dalgaard
On 05 Nov 2013, at 17:53 , Martin Maechler wrote: >> "PhGr" == Philippe Grosjean >>on Tue, 5 Nov 2013 17:02:19 +0100 writes: > >PhGr> On 05 Nov 2013, at 14:22, Martin Maechler >PhGr> wrote: > Kenn Konstabel on Tue, 5 Nov 2013 13:25:20 +0200 writes: >>>

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Martin Maechler
> "PhGr" == Philippe Grosjean > on Tue, 5 Nov 2013 17:02:19 +0100 writes: PhGr> On 05 Nov 2013, at 14:22, Martin Maechler PhGr> wrote: >>> Kenn Konstabel on Tue, 5 Nov >>> 2013 13:25:20 +0200 writes: >> >>> I just tried it on ubuntu but within RStud

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Philippe Grosjean
On 05 Nov 2013, at 14:22, Martin Maechler wrote: >> Kenn Konstabel >>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

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Martin Maechler
> Brian G Peterson > 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. >> >

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Renaud Gaujoux
Thanks for the clarification. This appears to be a terminal behaviour issue. It is user lack-of-understanding: there is no error here. > I believe lack of understanding is probably amongst the top reasons why users post to the list and get happily enlightened. I don't think I said there was an er

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Brian G. Peterson
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 outpu

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Martin Maechler
> Kenn Konstabel > 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

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Prof Brian Ripley
It is user lack-of-understanding: there is no error here. R outputs a b c backspace newline How the terminal displays that is up to the terminal, which was unstated. (Capture the output and look at it in a hex editor.) For a b c backspace a normal terminal will output the prompt and overw

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Kenn Konstabel
I just tried it on ubuntu but within RStudio: > cat("abc\b") ab > cat("abc\b\n") ab > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C LC_COLLATE=C [5] LC_MONETARY=CLC_MESSAGES=CLC_P

Re: [Rd] cat with backspace and newline characters

2013-11-05 Thread Renaud Gaujoux
Maybe it's a Linux problem: > cat("abc\b") ab> cat("abc\b\n") abc > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESS

Re: [Rd] cat with backspace and newline characters

2013-11-01 Thread Rui Barradas
Hello, Can't reproduce it, there must be something with your console. I get > cat("abc\b") ab> cat("abc\b\n") ab > Hope this helps, Rui Barradas Em 01-11-2013 11:06, Renaud Gaujoux escreveu: Hi, when mixing newline and backspace characters I get the following output (see below). In the sec

Re: [Rd] cat with backspace and newline characters

2013-11-01 Thread Renaud Gaujoux
I don't know what the normal behaviour is. I was expecting the remaining of the line to be wiped out, but you must be right: the character 'c' is already printed, the cursor moves back one position and go to the next line, leaving the 'c' in place. But what about this one: > cat("abc\b\b\b") > c

[Rd] cat with backspace and newline characters

2013-11-01 Thread Renaud Gaujoux
Hi, when mixing newline and backspace characters I get the following output (see below). In the second call, the backspace character is simply not applied. Is this normal behaviour? Thank you. > cat("abc\b") ab> cat("abc\b\n") abc > [[alternative HTML version deleted]] _