From ernest.turro at ic.ac.uk  Tue Mar 20 12:53:40 2007
From: ernest.turro at ic.ac.uk (Ernest Turro)
Date: Tue, 20 Mar 2007 11:53:40 +0000
Subject: [Rd] Carriage returns and Sweave output
In-Reply-To: <17919.37635.203919.143033@stat.math.ethz.ch>
References: <30B148B0-0C89-49BA-AEC9-160A6BA72D56@ic.ac.uk>
	<45FEA2FB.7030105@ebi.ac.uk>
	<DC49D83C-7739-4CEA-A837-0200D658BED7@ic.ac.uk>
	<45FEAE58.4030208@ebi.ac.uk>
	<17919.37635.203919.143033@stat.math.ethz.ch>
Message-ID: <E8DDD4AC-6B1B-449E-A805-E99B52EAA498@ic.ac.uk>


On 20 Mar 2007, at 07:53, Martin Maechler wrote:

>>>>>> "Wolfi" == Wolfgang Huber <huber at ebi.ac.uk>
>>>>>>     on Mon, 19 Mar 2007 15:38:00 +0000 writes:
>
>>> the problem with results=hide is that it suppresses everything. I  
>>> just
>>> need Sweave to suppress strings ending in '\r'...
>
>
>     Wolfi> Dear Ernest,
>
>     Wolfi> IMHO it is good practice to make the printing of these  
> progress reports
>     Wolfi> ("sweep 4 of 1024\r") optional and produce them only if  
> the user calls
>     Wolfi> your function with, say, "verbose=TRUE",
>
> I strongly agree.
>
>     Wolfi> and furthermore set the default value of the
>     Wolfi> 'verbose' argument to "verbose=interactive()".
>
> or -- typically my choice -- to  'verbose = getOption("verbose")
>
> Martin Maechler, ETH Zurich
>
>     Wolfi> Best wishes
>     Wolfi> Wolfgang
>
>  [............]
>

I agree that users should be free to choose the level of verbosity.  
Here, I want to show the verbose output and print it onto the tex  
file using Sweave to give users a good idea of what happens. What I  
don't want is countless lines being printed because \r is being  
interpreted as \n ...

Thanks,

Ernest






>>>> Ernest Turro wrote:
>>>>> Dear all,
>>>>> I have a code chunk in my Rnw file that, when executed, outputs
>>>>> carriage return characters ('\r') to inform on the progress (e.g.
>>>>> "sweep 4 of 1024\r"). But Sweave interprets this as a newline
>>>>> character, and therefore I get countless pages of output in my
>>>>> vignette where I only really want one line. Any ideas?
>>>>> Thanks
>>>>> E



[Rd] Carriage returns and Sweave output
Ernest Turro