CRAN Task View: Reproducible Research
|Contact:||max.kuhn at pfizer.com|
The goal of reproducible research is to tie specific instructions to data analysis
and experimental data so that scholarship can be recreated, better understood and
R largely facilitates reproducible research using literate programming; a document
that is a combination of content and data analysis code. The
function (in the
base R utils package) can be used to blend the subject matter and R code
so that a single document defines the content and the algorithms.
Basic packages can be structured into the following groups:
packages contain functions to write
R objects into LaTeX representations.
also includes methods for
translating strings to proper LaTeX markup (e.g., ">=" to "$\geq$"). Animations
can be inserted into LaTeX documents being converted to PDF via the
packages can convert R graphics to native LaTeX code while
function in the base grDevices package is a PicTeX graphics
package for Linux streamlines the generation of
Sweave files using
has drivers that allow
to process HTML documents via
can be used to build HTML pages sequentially.
can also convert some
R objects into HTML representations.
Open Document Format
Word processing tools, such as OpenOffice.org, can then be used to blend content and programs.
Many word processors can be used to translate the ODF document to other formats
(e.g., Word, PDF, HTML, etc.)
packages for Windows can be used to communicate
between R and Word or PowerPoint
via the COM interface. Document elements (e.g. sections, text, images, etc) that
are created in R can be inserted into the document from R. Two commercial R products
that work with RTF and Word are
Inference for R
, respectively. The output from other
R2HTML) can also be opened by Word.
Plain Text Formats
R code and output in
files can be converted into
and other structured
text formats using the
package can render R
code with more control over the results (e.g., syntax coloring, etc) in LaTeX
package can also provide enhanced control over how
R code chunks and their output are rendered in LaTeX.
Caching of R Objects
packages allow caching of specific
code chunks. The
packages can also be used but are
not integrated with
can also cache graphics.
package (for shared reproducibility package management) creates
an R package that organize the results of an
document into different
directories (e.g., article, figures, etc).
packages contain alternative approaches
to embedding R code into various markups.
An incomplete list of packages which facilitate literate programming for specific
types of analysis or objects:
The base R utils package has generic functions to convert objects to
toLatex) and BibTeX (via
Functions for creating LaTeX representations of summary statistics and visualizations
can be found in the
also has functions for marking up data frames and the
packages can mark up matrices.
Cross-tabulations can be converted to LaTeX code using the
packages provide LaTeX
representations of some common models (e.g., Cox proportional hazards model, etc.).
For example, processing an
object with the
function will generate LaTeX markup of the ANOVA table. Similalry, methods exist
and other types of objects.
contains LaTeX markup functions for quantile regression
Standardized exams can be created using the
ODF and LaTeX functions, respectively, for survey sampling objects