[Bioc-devel] Sweave changes (keep.source = TRUE or FALSE?)

Seth Falcon sfalcon at fhcrc.org
Tue Dec 5 01:10:01 CET 2006


[I've moved this discussion to bioc-devel where it began and
belongs.  For those catching up, Fritz Leisch wrote some comments
about recent Sweave changes (mostly quoted below) and Duncan Murdoch
responded.  I have some comments added below.]

Duncan Murdoch <murdoch at stats.uwo.ca> writes:
> On 12/3/2006 11:55 AM, Friedrich Leisch wrote:
>> [ To Bioc-Core: This continues a discussion in R-core on the changes
>> Duncan Murdoch made to the parser and Sweave to keep original
>> formatting and comments of code chunks. ]
>> 
>> 
>> Sorry to join in late, I was travelling last week. First, let me thank
>> Duncan for his work, this really fixes one of the main drawbacks
>> Sweave had!
>> 
>> Hence, I agree with Duncan and Martin in that I would like to change
>> the default in R to keep.source=TRUE. But I understand Robert that
>> testing software gets hard if the tools which are used for testing
>> change.
>> 
>> As discussed by email this summer on r-devel I want to change another
>> Sweave default for 2.5: I want to set stylepath=FALSE and include no
>> \usepackage{/path/to/Sweave.sty} by default. This means in effect that
>> each Sweave file needs to be adapted, by either inserting
>> \usepackage{Sweave} or \SweaveOpts{stylepath=true} in the header. I
>> didn't implement the changes back then because the discussion was too
>> close to feature freeze.
>> 
>> I also will do some other Sweave changes over christmas break, but
>> those should all be safe, i.e., only add functionality.
>> 
>> Before people now start yelling at me: We can only improve software,
>> if we are allowed to change it and/or fix behavior that can be
>> considered a bug. And the paths inserted on Windows machines in an
>> English locale are buggy (and were so ever since ...).
>> 
>> To make future changes easier I want to suggest the following (for
>> BioC): Have all package authors insert a
>> 
>> 	\SweaveInput{BiocSweaveDefaults}
>> 
>> at the beginning of each vignette, and centrally provide a
>> BiocSweaveDefaults.Rnw file with settings we think are appropriate for
>> BioC (details to be discussed). With that we would have easy means of
>> 
>>  1) changing Sweave when necessary, but
>>  2) keeping defaults in sync for all BioC vignettes, and overriding
>>     changes we don't like.
>> 
>> If we include the usapackage{Sweave} statement in
>> BiocSweaveDefaults.Rnw, we have central control for all Sweave
>> processing options as well as for latex options like noae or nogin.
>> 
>> Comments?
>
> I think that looks like a good long-term solution.  For 2.5.0, would it
> be possible to put in place a way to change SweaveOpts defaults in
> vignettes with *no* changes to the vignettes?  I.e. some sort of
> external config file which set the defaults for any SweaveOpts setting.
> I'd suggest the search order for this file should be
>
>    - a location specified in the Sweave call
>    - the directory of the .Rnw file
>    - the home directory of the current user
>    - a new RHOME/share/Sweave directory, or possibly RHOME/share/texmf
>
> Duncan Murdoch

I like the idea of being able to modify SweaveOpts without having to
change the vignette contents.  For this to be usable for us, it needs
to get picked up by 'R CMD build', at least, because that is how
vignettes get built in our build system.

A central BiocSweaveDefaults.Rnw file could be more trouble than it is
worth.  It requires modifying all vignettes to include the file and
then there is the question of where such a file would live.
Generally, developers only maintain a single package and don't do a
checkout of everything.  Right now, packages are self-contained and I
would hate to see that change.  -- but I think something along these
lines could provide useful insulation against changes in Sweave that
we aren't ready for.

+ seth



Duncan M. and Fritz: perhaps you guys could subscribe to bioc-devel
for a short period of time so your messages will go through?



More information about the Bioc-devel mailing list