[R] SWEAVE - a gentle introduction

Marc Schwartz marc_schwartz at me.com
Tue Nov 17 16:42:49 CET 2015

> On Nov 17, 2015, at 9:21 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote:
> I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. 
> I have an R program that I want to run and have the output and plots in one document. I believe this can be accomplished with SWEAVE. Unfortunately I don't know HTML, but am willing to learn. . . as I said I need a gentle introduction to SWEAVE.
> Thank you,
> John


A couple of initial comments.

First, you will likely get some recommendations to also consider using Knitr:


which I do not use myself (I use Sweave), but to be fair, is worth considering as an alternative.

Second, to create stand alone documents, as opposed to web based content, you will likely want the output to be in TeX/LaTeX via Sweave, which can then become PDF based documents via the post processing of the TeX/LaTeX source. That is what I do for all of my analytic deliverables. You can also use LaTeX classes like 'Beamer' to create Powerpoint-like slides for presentation.

Fritz' web site for Sweave is here:


and there are some links to supporting materials there with very basic examples.

Another resource is:


and if you Google for Sweave Introductions and Tutorials, there are a myriad of others.

In conjunction with Sweave itself, there are a variety of supporting packages on CRAN that have related functionality (e.g. formatted LaTeX output) that are worth knowing about and are included in the Reproducible Research task view:



Marc Schwartz

More information about the R-help mailing list