Skip to content

Sweave Feature Requests and Questions

4 messages · Charlotte Maia, Duncan Murdoch, Roger D. Peng

#
Hi everyone,

I would like to request the following features for Sweave:
1. The keep.source option, to respect empty lines in input.
2. The prefix.string option, to apply to all generated files, e.g. no
Rplots.pdf.
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.
4. A new option to allow generation of Serror chunks, where the R code
generates an error or a warning.

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?
2. Does anyone know a simple workaround to problem 3, without killing
the entire Sweave.sty file?

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?


kind regards
#
Charlotte Maia wrote:
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.
Why do you want to keep Rplots.pdf?  I think a more reasonable request 
is not to produce it at all.
I think this is an option.  Use something like

\usepackage[nogin]{Sweave}

to turn it off.
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).
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?
Besides the one above, you can use \setkeys{Gin}  to change the default 
size of graphics.
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
1 day later
#
Hi Duncan, thank you for the comprehensive reply.

Firstly, though, I'm using Fedora 10.
Running Latex through Make is really fast, Sweave isn't.

I'll try [nogin] later, assuming it works, it will make my life a lot
easier, so a big thank you on that one.

On the Rplots issue, I don't want them, however Sweave produces them.
I find the task of deleting intermediate files (say for R package
vignettes) more difficult than it needs to be.


kind regards
Charlotte

On Sun, May 9, 2010 at 12:40 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:

  
    
1 day later
#
Hi, see below.
On Sat, May 8, 2010 at 7:35 PM, Charlotte Maia <maiagx at gmail.com> wrote:
<snip>
This can be worked around if you have code sections that don't change
at all, put them in a separate file and import them into the "main"
LaTeX document using '\input'. Then use the Makefile to specify the
dependencies between the LaTeX files. That way, when you run make the
first time, everything will run, but on subsequent calls to make,
Sweave will not be called as long as the code in the separate file
hasn't changed.
I don't think I've used postscript in about 8 years.

-roger