Sweave
knitr
and LaTeX knitr
Sweave
and LaTeX
: rlatex
GitHub project: the most up-to-date approach using LaTeX packages knitrl
and spaper
and others
knitr
howto and template
LaTeX
"preamble" to use in your .nw file: Sweave.Template.nw
Sweave
Manual and example .nw Sweave
files used in the Sweave
manual can be found here.
LaTeX
can be found here.
Sweave
from within Emacs
makefiles
\end{document}
expression if you get the following error from Sweave
:Warning message:
incomplete final line found by readLines on `blah.nw'
.nw
file: %
(percent) signs (the LaTeX
comment symbol) to comment out lines of text and whole R code chunks (i.e., from the <<>>=
to the @
headers).
#
(number) signs (the R comment symbol) to comment out lines of R code within an R code chunk (i.e., between the <<>>=
to the @
headers).
Sweave
as a batch process outside of R (i.e., from a konsole
command prompt), run this command: R CMD Sweave foo.Rnw
, replacing .Rnw
with .nw
or whatever you use for the file suffix. You may want to run this command after R finishes if you have set up to use a directory graphics
and forgot to tell Sweave
not to create .eps
files when you are using pdflatex
: rm -f Rplots.ps graphics/*.eps
Sweave
documents. .nw
file used to create the linked pdf file: RCitation.nw
.bib
file to create and reference: Rbiblioref.bib
upData()
function invocation to generate a long variable label that will automatically wrap in the LaTeX
version of a summary.formula()
(with reverse = TRUE
) table. The strwrap()
function width=
argument will dictate how wide the label is.
pgfSweave
allows you to use the excellent tikz
graphics driver that produces LaTeX code to render R graphics. To install it do the following:
install.packages(c('getopt', 'cacheSweave', 'stashR')) install.packages('pgfSweave', repos='http://R-Forge.R-project.org')Soon we will had a template for its use. For details see http://cran.at.r-project.org/web/packages/pgfSweave.
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
![]() |
fhsweave.pdf | manage | 523 K | 27 Oct 2014 - 16:46 | FrankHarrell | knitr for Reproducible Research and Beautiful Statistical Reports |
![]() |
fhsweaveEx.Rnw | manage | 7 K | 27 Oct 2014 - 16:45 | FrankHarrell | knitr source file for enhanced report |
![]() |
fhsweaveEx.pdf | manage | 333 K | 27 Oct 2014 - 16:46 | FrankHarrell | Example enhanced report |