From murdoch at stats.uwo.ca  Thu Jan 11 15:53:41 2007
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 11 Jan 2007 09:53:41 -0500
Subject: [Rd] Wishlist: Sweave: allow line breaks after forward slashes
 (PR#9443)
In-Reply-To: <20070111140700.45BD75730B@slim.kubism.ku.dk>
References: <20070111140700.45BD75730B@slim.kubism.ku.dk>
Message-ID: <45A64F75.9040906@stats.uwo.ca>

On 1/11/2007 9:07 AM, ahenningsen at email.uni-kiel.de wrote:
> Full_Name: Arne Henningsen
> Version: 2.4.0
> OS: Linux
> Submission from: (NULL) (134.245.140.242)
> 
> 
> Sweave does not allow line breaks after forward slashes ("/"). This might lead
> to a long "substring" of a command that cannot be wrapped. Hence, Sweave either
> keeps this long "substring" in the current line and produces a too long line or
> it moves the entire "substring" in the following line and leaves the current
> line rather empty. This problem can be solved if Sweave is allowed to introduce
> line breaks after forward slashes. (I guess that this problem can also be solved
> if parse() adds a blank after a forward slash.)
> 
> Example: 
> The following expression cannot be wrapped by Sweave:
> 
> mean(myDataframe$myFirstVariable)/mean(myDataframe$mySecondVariable)

It's actually deparse() that causes this, but the problem is already 
solved in R-devel (to become R 2.5.0).  If you don't like the formatting 
that deparse() gives to one of your expressions, use the Sweave option
keep.source=TRUE, and your original formatting will be kept for that 
chunk.  Or globally retain your formatting via 
\SweaveOpts{keep.source=TRUE} at the start of your file.

Duncan Murdoch



[Rd] Wishlist: Sweave: allow line breaks after forward slashes (PR#9443)
Duncan Murdoch