Easier literate programming with R by Christophe Lalanne.
From the post:
I have been using Sweave over the past 5 or 6 years to process my R documents, and I have been quite happy with this program. However, with the recent release of knitr (already adopted on UCLA Stat Computing and on Vanderbilt Biostatistics Wiki) and all of its nice enhancements, I really need to get more familiar with it.
In fact, there’s a lot of goodies in Yihui Xie‘s
knitr
, including the automatic processing of graphics (no need to callprint()
to display alattice
object), local or global control of height/width for any figures, removal of R’s prompt (R’s output being nicely prefixed with comments), tidying and highlighting facilities, image cropping, use offramed
orlistings
for embedding code chunk.To overcome some of those lacking features in
Sweave
, I generally have to post-process my files using shell scripts or custom Makefile. For example, I am actually giving a course (in French) on introductory #rstats for biomedical research and I provide a series of exercices written with Sweave. I can easily manage my graphics to have the desired size using a combination of SweaveGin
andlattice
‘saspect=
argument. However, the latter means I have to crop my images afterwards. Moreover, I need to “cache” some of the computations and there’s no command-line argument for that, unless you rely on pgfSweave. This leads to complicated stuff like…
Any post that makes content generation less complicated or less of a one-off task, sounds good to me.