Skip to main content
edited based on comment from OP
Source Link

I'll bite with the obvious answer; brew/SweaveNew answer based on comment below:

As I understand, Method 1 is better for producing reports with LaTeXto mix R code and R2HTML/Sweave for producing reports with HTML. (Noting that R2HTML has an or LaTeX in the same document, using Sweave driver as well.) There's alsoor brew for example, to create a third optionfinal document, odfWeavewhile Method 2 is to use R code to generate HTML or LaTeX, which usesusing the Open Document Format used by OpenOfficeR2HTML or Hmisc packages for example, and othersthen to just run the R code to create the final document. All help you do reproducible research, I've mostly just used Method 1 but will weigh in basically the same wayanyway. I don't know

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 otherother; they're both ways to make your research reproducible.

I'd personally preferI think Method 1 is easier because you don't have to know what the Sweave driver forR functions are that create the LaTeX or the HTML rather than usingcode; you just write R code, and you write HTML or LaTeX code, and the R2HTML functionssoftware 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 makewrite the HTML output; thatR 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 analysisresults from the text about it a littlecommentary more cleanly, in my opinion.

I'd guess that more people doing this use LaTeX rather HTML because peopleHowever, for short snippets or just outputting the results from academia already know LaTeX and need their articles to be in LaTeX anyway. Most probably also feel that a report done in LaTeX (or odfWeavecommand with no commentary, using R2HTML or Hmisc might be easier, though less so(speaking from my experience) also looks more professional than an HTML report. For these individuals, it's definitely less work to use LaTeX/Sweave method; we used to have to do what Sweave does by hand; now it's just one steponce you're in the habit of Sweaving, and is easily reproducible tooyou'll never go back.

I'll bite with the obvious answer; brew/Sweave is better for producing reports with LaTeX and R2HTML/Sweave for producing reports with HTML. (Noting that R2HTML has an Sweave driver as well.) There's also a third option, odfWeave, which uses the Open Document Format used by OpenOffice and others. All help you do reproducible research, in basically the same way. I don't know of any technical or statistical reason to prefer one over the other.

I'd personally prefer the Sweave driver for HTML rather than using the R2HTML functions to make the HTML output; that separates the analysis from the text about it a little more cleanly.

I'd guess that more people doing this use LaTeX rather HTML because people from academia already know LaTeX and need their articles to be in LaTeX anyway. Most probably also feel that a report done in LaTeX (or odfWeave, though less so) also looks more professional than an HTML report. For these individuals, it's definitely less work to use LaTeX/Sweave method; we used to have to do what Sweave does by hand; now it's just one step, and is easily reproducible too.

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.

Source Link

I'll bite with the obvious answer; brew/Sweave is better for producing reports with LaTeX and R2HTML/Sweave for producing reports with HTML. (Noting that R2HTML has an Sweave driver as well.) There's also a third option, odfWeave, which uses the Open Document Format used by OpenOffice and others. All help you do reproducible research, in basically the same way. I don't know of any technical or statistical reason to prefer one over the other.

I'd personally prefer the Sweave driver for HTML rather than using the R2HTML functions to make the HTML output; that separates the analysis from the text about it a little more cleanly.

I'd guess that more people doing this use LaTeX rather HTML because people from academia already know LaTeX and need their articles to be in LaTeX anyway. Most probably also feel that a report done in LaTeX (or odfWeave, though less so) also looks more professional than an HTML report. For these individuals, it's definitely less work to use LaTeX/Sweave method; we used to have to do what Sweave does by hand; now it's just one step, and is easily reproducible too.