\documentclass{article}

\usepackage{pgf}
\pgfrealjobname{example}
\title{pgfSweave Example}
\author{Cameron Bracken}    

\usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/Sweave}
\begin{document}
\maketitle
In this example we embed parts of the examples from the \texttt{kruskal.test} 
help page into a \LaTeX{} document:

\begin{Schunk}
\begin{Sinput}
> data(airquality)
> library
> kruskal.test(Ozone ~ Month, data = airquality)
\end{Sinput}
\end{Schunk}
which shows that the location parameter of the Ozone distribution varies 
significantly from month to month. Finally we include a boxplot of the data:

\begin{center}
\beginpgfgraphicnamed{pgfSweave-example-plot}
\input{pgfSweave-example-plot.pgf}
\endpgfgraphicnamed
\end{center}

\end{document}
