[R] Supressing empty sections with Sweave

Mikkel Grum mi2kelgrum at yahoo.com
Fri Dec 31 13:05:35 CET 2004


Dear useRs,

I'm writing regular survey reports using Sweave. Each
report has several sections along the lines of:

\section*{Disease X}

<<MapX,fig=TRUE,echo=FALSE>>=
image(vectorx,vectory,matrixz)

@

Notes with or without Sexpr{a}.

\vfill

\pagebreak

\section*{Disease Y}
<<MapY,fig=TRUE,echo=FALSE>>=
...etc.


Often one or more of the diseases is not observed (all
values in matrixz are 0), in which case I would prefer
not to display the section at all.  Does any one no
whether it is possible automate this with Sweave?

Mikkel




More information about the R-help mailing list