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

Duncan Murdoch murdoch at stats.uwo.ca
Thu Dec 7 12:04:58 CET 2006


On 12/6/2006 10:24 PM, Robert Gentleman wrote:
> On 12/6/06, Friedrich Leisch <friedrich.leisch at stat.uni-muenchen.de> wrote:
>>>>>>> On Tue, 05 Dec 2006 15:23:24 -0500,
>>>>>>> Duncan Murdoch (DM) wrote:
>>   > Right, that's what we want to do.  But I want an easier way for
>> someone
>>   > with an existing document to get the old behaviour.
>>
>>
>> My plan would be the following:
>>
>> 1) Set the default of all Sweave options via options(), such that it
>>    can be changed in the Rprofile of a site-wide installation or in a
>>    user's ~/.Rprofile file or even on a per-directory basis. This will
>>    also result in R CMD build reading the desired defaults.
> 
> 
> 
>   I guess I don't see how this would work, or just what value there would be
> in it. Typically global options are useful for things that are entirely
> under the control of the user.
>   For Sweave, I hope that all attributes are directly under the control of
> the author. The user must respect the choices of the author to see the
> document as intended and so I guess I am missing how this idea would be of
> any use.

The plan is just about setting the defaults.  If the author cared to set 
a specific value that would be respected.

For people like you with existing vignettes, there would be changes to 
the formatting (assuming we follow Fritz's and my proposal to change the 
default from the old keep.source=FALSE value) because you wouldn't have 
known to set this option before it existed, and that's a valid concern. 
  I'm not sure Fritz's proposal would help you to make a single small 
change to your package so that all vignettes in it follow the old 
convention.  Currently you need to make a per-vignette change (and could 
make per-chunk changes if you want).

>   Whether keep.source is TRUE or FALSE needs to be honored on either a per
> document (or more realistically per chunk) basis. And so that is what R CMD
> build is going to need to deal with appropriately.

That's already in place (per chunk settings overriding per document 
settings overriding Sweave call settings), and I don't think there are 
plans to change it.

>   Some options may of course be such that a global switch is fine, but if
> you do it via options then some package authors may feel that they have a
> right to set the options for their package - this is one reason why global
> options are seldom that good of an idea.
> 
> 2) Have something like
>>         R CMD Sweave --opts "additional args passed to Sweave() call"
>>    to be able to override it even from the shell.
> 
> 
> 
>   Again, I just don't see how this is a good idea. Every document needs to
> have its own explicit handling instructions for all chunks. It makes no
> sense to let me process the document differently from what the author wants
> or requires.
> 
>   The only thing that is up for grabs is the default setting - what to do it
> nothing is specified.
> Documents that want that need specify nothing, everyone else has to modify
> their document to explicitly state handling instructions.  If something is
> specified, at either the document or chunk level it ought to be honored. The
> idea that different people might decide to process it differently seems not
> very useful to me.

That's not being suggested, Fritz was just talking about the default case.

Duncan Murdoch
> 
> 
> 
> If BioC decides to default to keep.source=FALSE and stylepath=TRUE
>> then it will not be necessary to touch any existing vignettes. R CMD
>> check and build currently run R --vanilla and hence ignore the stuff in
>> 1), so will need changes there, too. But nothing that's not doable,
>> I'll give it a shot over Christmas break.
>>
>> Best,
>> Fritz
>>
>>
>>
>>
> 
>



More information about the Bioc-devel mailing list