Wednesday, April 28, 2010

Sweave vs. pgfSweave

I think pgfSweave should replace the default of Sweave system because it brings significant improvements over the original Sweave. I certain have made it my default Sweave tool on my system.

------------------------------- EDITED ON MAY 1, 2010 --------------------------------------

Since StatET made Sweaving so simple and easy, I don't have incentive to work directly on LaTeX documents any more. It is actually much simpler and more intuitive to work directly on a Sweave documents and see results in the final PDF output.


Morten Lindow said...

care to tell us why? :-)
/a curious Sweave-user

Unknown said...

Ditto. Also, if you could speak to whether pgfSweave can be integrated into StatET (for eclipse) easily, I would find that interesting.

Shige said...

Assume you have already setup Sweave as an "external tool"; what you need to do is to simply change the command line from "Sweave(file = "${resource_loc:${source_file_path}}")" to "pgfSweave(file = "${resource_loc:${source_file_path}}")". Also make sure that your R console automatically loads the pgfSweave each time it starts. This can be done by add "library(pgfSweave)" under "R snippet run after startup".

Even better, instead of replacing Sweave with pgfSweave, I have both of them configured.

Shige said...

Two main advantages of pgfSweave over plain Sweave make it very attractive: (1) the quality of graphs produced, and (2) the ability to cache some time-consuming graph generating procedures.

Since pgfSweave is still under development, it may safer to configure and use both on your system.

Jermdemo said...

Quality of graphs? Isn't that a simply a matter of which plotting package you are using in R?

What Sweave desperately needs is conditionals - so you can use logic to determine whether a section of a Sweave document should be rendered.

Anonymous said...

caching graphs can be done through the [draft] option of \documentclass

JennyH said...

I have sweave working perfectly within Eclipse, but am currently and frustratingly unable to get pgfsweave to work properly using the sweave external launch configuration modified as you describe (or any other way I've played with). pgfSweave works just fine if I run it from the R console within Eclipse, but there must be something odd with my external launch configuration, as it gets hung up processing a figure, and never gets to generate the figure's pdf file and the focus never comes back to the R console... Have you experienced this? Any suggestions? (I'm working on Windows 7 with Eclipse Helios, and any of R 32 or 64 bits R 2.13.2 or 2.14.0 - the problem is the same with all).

Shige said...

I have not used Eclipse under Windows. Sorry.

Why don't you post the question to the StatET mailing list? I am sure there are other people who run StatET on Windows and some of them may have encountered similar problem.

Good luck!