Comparing reproducible research strategies: brew or Sweave vs. R2HTML This is a bit more "think about it" question - but I see it as an important one to ask.
I have been struggling for the past few days with having a more reproducible-research-like workflow.  I am confused with the two different strategies for writing a report.
The two strategies are:


*

*Sweave or brew. Where there is a report.Rnw or report.brew file that has a mixture of some markup language (either HTML or LaTeX) and R code between special braces (say <<>>=  @).  This file needs to be run through Sweave or brew in order to create the report file (report.html or report.tex).

*R2HTML (for HTML) and Hmisc (for LaTeX). Where the .r file uses R functions to construct report.html or report.tex; running the R commands generates the report directly.


What is clear to me is that most people online seem to be using option 1.  But I do not understand why it is so common, when option 2 seems to me (without too much experimenting) to be less work.
When is each of the two strategies better?    
 A: New answer based on comment below:
As I understand, Method 1 is to mix R code and HTML or LaTeX in the same document, using Sweave or brew for example, to create a final document, while Method 2 is to use R code to generate HTML or LaTeX, using the R2HTML or Hmisc packages for example, and then to just run the R code to create the final document.  I've mostly just used Method 1 but will weigh in anyway.
As I see it, it's really just a matter of preference; I don't see any technical or statistical reason to prefer one over the other; they're both ways to make your research reproducible.
I think Method 1 is easier because you don't have to know what the R functions are that create the LaTeX or the HTML code; you just write R code, and you write HTML or LaTeX code, and the software takes care of putting them together.  This is especially true when the R output only is a small amount of the final document; it would be a pain to write the R code necessary to output a lot of text, for example.  In smart text editors, you also get the right syntax formatting for each kind of code which you don't get when using R2HTML or Hmisc.  This method also separates the results from the commentary more cleanly, in my opinion.
However, for short snippets or just outputting the results from a command with no commentary, using R2HTML or Hmisc might be easier, though (speaking from my experience), once you're in the habit of Sweaving, you'll never go back.
A: These are just a few points.


*

*If you want to just write simple reports, then the set of LaTeX commands that you need to learn is a lot smaller than if you want to do complex things.

*An appealing aspect of LaTeX over some simple markup systems is that if you want features like referencing, automatic numbering, multi-page tables, attractive type setting, these features are available. In particular, there have been features that initially I hadn't even thought of, but when I have needed them, they have been available in LaTeX as a package.

*If you want your final report in a different format, such as HTML or rtf, then you can use various conversion programs like pandoc to convert the latex into that format.

A: The other nicE thing potentially about LaTeX or another markup in the Sweave/odfWeave/asciiWeave paradigm is that for repeated reports you can template it a bit better once and then just reuse the template. See Harrell's rreport package as an example
A: You're pretty safe in using either - though I confess I don't use either at all. I suspect the primary reason for the popularity of the LaTeX/Sweave method is the number of fields that use LaTeX as their primary paper/presentation/manuscript format that incentivizes using a LaTeX based system. I don't know of a single field where a .html end product is all that directly useful.
A: The reason option 1 is so common is because...it is so common. Sweave has been around for the better part of 10 years and, for many R users, is synonymous with reproducible research. Furthermore, the sorts of people who would hear the phrase 'reproducible research' and think 'that sounds great' are probably likely to already be familiar with LaTeX. Thus, it is not as if they are picking between two options because many won't know that option 2 even exists.
