Skip to content
Prev 127167 / 398500 Next

One pdf file with plots and text output

You create a source file ("GrowthAll.Rnw") that looks a bit like this

\documentclass[11pt]{report}
\usepackage{Sweave}
\SweaveOpts{echo = FALSE}
\begin{document}

<<fig = T>>=
x.lm <- lm()
plot(x.lm)
@

<<>>=
summary(x.lm)
@
\end{document}


Then run in R: 
Sweave("GrowthAll.Rnw")
system("pdflatex GrowthAll")

Have a look at the Sweave manual. It contains some examples.

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx op inbo.be
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney