[Rd] Does anyone use Sweave (RweaveLatex) option "expand=FALSE"?

Claudia Beleites cbeleites at units.it
Fri Aug 20 11:38:32 CEST 2010


Dear Kevin,

thank you for the explanation.

 > I use it, frequently. The idea for it goes back to some of Knuth's
 > original literate programming ideas for developing weave and tangle when
 > he was writing TeX (the program).  I want to be able to document the
 > pieces of some complex algorithm without having to see all of the gory
 > details.  For instance, I have code that looks like the following.
 > (Note that this is typed on the fly rather than copied from actual
 > source, so there may be typos.)
 >
 > <<mainloop,keep.source=TRUE,expand=FALSE>>=
 > for (i in 1:nSamples) {
 > <<getInfoAboutThisSample>>
 > for (j in 1:nChromosomes) {
 > <<getChromosomeDataForCurrentSample>>
 > <<normalizeChromosomeData>>
 > <<findSegments>>
 > <<computeSignificance>>
 > <<writeResults>>
 > }
 > }
 > @

Sounds & looks like after invention of the macro and before invention of the 
function?

However, I'll stay with functions: my new RAM already arrived :-)
But: you never know. It may come handy some day also for me.

I'll be a great fan of errors reported with line number! And if the reporting 
isn't that convenient in expand = FALSE chunks, it still helps a lot in many, 
many  expanded chunks, right?.


My 2 ct,

Claudia

-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbeleites at units.it



More information about the R-devel mailing list