[Rd] Sweave Feature Requests and Questions

Duncan Murdoch murdoch.duncan at gmail.com
Sun May 9 02:40:56 CEST 2010


Charlotte Maia wrote:
> Hi everyone,
>
> I would like to request the following features for Sweave:
> 1. The keep.source option, to respect empty lines in input.
>   

I think it's too late for that one.  keep.source was introduced in 2006, 
and there were a large number of unreasonable complaints about it -- so 
many that I'm not going near that again.

> 2. The prefix.string option, to apply to all generated files, e.g. no
> Rplots.pdf.
>   

Why do you want to keep Rplots.pdf?  I think a more reasonable request 
is not to produce it at all.

> 3. That Sweave, doesn't change the graphics settings for the entire
> Latex Document. By default including a pdf image, should use it's
> actual size, rather than making it a fixed proportion of the text
> width.
>   

I think this is an option.  Use something like

\usepackage[nogin]{Sweave}

to turn it off.

> 4. A new option to allow generation of Serror chunks, where the R code
> generates an error or a warning.
>   

That's a good idea that has been suggested before.  I think it's just a 
matter of someone doing it (or it may have been done in one of the 
Sweave add-on packages).
> Furthermore, any help appreciated here:
> 1. Does anyone know how to build Sweave documents, using Make, without
> starting a new instance (or multiple instances) of R, every time Make
> is called?
>   

I think the generic answer here is that you shouldn't be using an OS 
where starting new instances is so time consuming.  Make is designed for 
OS's where it's rather cheap to start the same program many times.   So 
maybe you should suggest to Microsoft (I'm assuming you're on Windows) 
about that fact that it is so slow at this common task?

> 2. Does anyone know a simple workaround to problem 3, without killing
> the entire Sweave.sty file?
>   

Besides the one above, you can use \setkeys{Gin}  to change the default 
size of graphics.
> Furthermore, I'm temped to stop Sweave from generating all the eps
> files (I saw an option for this in the Sweave documentation), however
> I'm concerned it may stop others from building the document, if they
> use postscript.
>
> Then again, do enough people use postscript, to warrant such consideration?
>   

I think this depends on your audience, but probably most users of a 
document written using Sweave are just going to read the PDF that you 
produced, they aren't going to process it themselves.  On the other 
hand, those eps files are handy because they allow you to work with .dvi 
files, and .dvi previewers are still smarter than .pdf previewers, for 
things like reverse search.  (Use patchDVI so reverse searches go to the 
.Rnw file, not the intermediate .tex file.)  So I leave Sweave producing 
both pdf and eps.  Disk space is cheap.

Duncan Murdoch



More information about the R-devel mailing list