[R] Stangle and annotate

Duncan Murdoch murdoch at stats.uwo.ca
Wed Mar 7 00:24:47 CET 2007


On 3/6/2007 5:20 PM, Brett Presnell wrote:
> How exactly should I go about turning off annotation when running
> Stangle (Rtangle) with "R CMD Stangle myfile.Rnw"?
> 
> Ideally I would like to be able to turn annotation off and on for
> individual code chunks, or maybe better, to annotate only named
> chunks.  Are either of these things easily done?
> 
> Is there some way to figure out this sort of thing without reading
> through the source code in Sweave.R?

I don't think R CMD Stangle has a way to pay attention to optional args 
to Stangle, but this works:

echo "Stangle('myfile.Rnw', annotate=F)" | Rterm --slave

Duncan Murdoch



More information about the R-help mailing list